-
Notifications
You must be signed in to change notification settings - Fork 21.6k
Commit
This handler simply allows arbitrary Ruby code as a template
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
body = "" | ||
body << ["Hello", "from", "Ruby", "code"].join(" ") | ||
body |
5 comments
on commit ab7ae68
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pretty annoying change.
If you have any .rb
files under a view path, AP is going to try to precompile them.
Just put a module under app/views
echo "module Foo; end" > app/views/foo.rb
and your app will just crash will an error message saying "module definition in method body"
.
My personal usage is mustache view classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@josh I added this since @dhh asked for it after of see it in Railscasts, I will talk with him on CF to check if we can found any solution or if we should revert this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that jbuilder (and similar extensions) use its own extension, not .rb
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll just go with .ruby for now, then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in de1060f
:source.to_proc
🤘