I''d like to use ERB in my JS templates. Sometimes I want <%= image_tag %>, other times I might want something more serious/non-assety like < %= form_for %>. (There was an issue for Sprockets to allow for ActionView to be used in the asset pipeline so that that could work: https://github.com/sstephenson/sprockets/issues/218, but it turns out it''s not so simple.) I guess there are a few ways that I could do this, so I''m looking for a best practice. How do you handle view helpers, like form_for? Do you render your template within the view, or do you just use old school pure html, or are there any bridge approaches? Right now we''re trying out codebrew''s backbone-rails gem, but we definitely need to find a migration path for the extensive system of view helpers both in Rails and in our own project that we''d like to reference. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I''d like to use ERB in my JS templates. Sometimes I want <%= image_tag %>, other times I might want something more serious/non-assety like <%form_for %>. (There was an issue for Sprockets to allow for ActionView to be used in the asset pipeline so that that could work: https://github.com/sstephenson/sprockets/issues/218, but it turns out it''s not so simple.) I guess there are a few ways that I could do this, so I''m looking for a best practice. How do you handle view helpers, like form_for? Do you render your template within the view, or do you just use old school pure html, or are there any bridge approaches? Right now we''re trying out codebrew''s backbone-rails gem, but we definitely need to find a migration path for the extensive system of view helpers both in Rails and in our own project that we''d like to reference. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.