Hi, I have a model "Script" can be convert to css with #to_css. But "format.css { render css: @script }" in an action''s #respond_to will cause an ActionView::MissingTemplate. I think it wants I put a template in view. How can I avoid that? Thanks. Best regards, Zhi-Qiang Lei zhiqiang.lei-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org -- 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.
On Mar 9, 2012, at 1:38 PM, Zhi-Qiang Lei wrote:> Hi, > > I have a model "Script" can be convert to css with #to_css. But "format.css { render css: @script }" in an action''s #respond_to will cause an ActionView::MissingTemplate. I think it wants I put a template in view. How can I avoid that? Thanks.Try adding layout: nil to your arguments. Walter> > Best regards, > Zhi-Qiang Lei > zhiqiang.lei-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org-- 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.
Still the same, why it does not behave like json? On Mar 10, 2012, at 3:10 AM, Walter Lee Davis wrote:> > On Mar 9, 2012, at 1:38 PM, Zhi-Qiang Lei wrote: > >> Hi, >> >> I have a model "Script" can be convert to css with #to_css. But "format.css { render css: @script }" in an action''s #respond_to will cause an ActionView::MissingTemplate. I think it wants I put a template in view. How can I avoid that? Thanks. > > Try adding layout: nil to your arguments. > > Walter > >> >> Best regards, >> Zhi-Qiang Lei >> zhiqiang.lei-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > -- > 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. >Best regards, Zhi-Qiang Lei zhiqiang.lei-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org -- 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.