0.02
No commit activity in last 3 years
No release in over 3 years
Allows you to create .js.coffee views
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 3.2.0
 Project Readme

CoffeeViews

Inspired by coffeebeans but with fixes:

  1. Doesn't compile coffeescript everytime in production
  2. Smart replacements for <%=%>

Use #to_json in safe mode

<%=  x %> # replaced with `<%== (x).to_json %>`

Use raw mode in raw mode

<%== x %> # replaced with `<%== x %>`

Installation

In your Gemfile:

gem "coffee-views"

Dependencies

This library depends on the coffee-script gem

Usage

# in create.js.coffee
$("#item").html <%= render "user/card" %>

Note: There is no need to call j or escape_javascipt helpers.

Coffee Script string interpolation like syntax (#{=} for safe and #{==} for raw):

# in update.js.coffee
alert "hello #{= @user.name}"

You can use coffeeview: embedded engine in slim

h1 Say Hi
coffeeview:
  alert <%= @some_view_string %>