Skip to content

Instantly share code, notes, and snippets.

@brutuscat
Created February 14, 2012 09:59
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brutuscat/1825444 to your computer and use it in GitHub Desktop.
Save brutuscat/1825444 to your computer and use it in GitHub Desktop.
Rails HAML Json render
:plain
[
- @movies.each do |movie|
:plain
{
"name":"#{movie.name}",
"description":"#{j(movie.description)}"
},
]
...
@movies = Movie.all
respond_to do |format|
format.json { render }
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment