kuraga
2012-Aug-18 10:58 UTC
Suggestion; a mechanism to specify asset path for controller (or specified actions)
Good day! Rails have *layout* method that allows you to specify a layout for controller or some it actions. So we can specify a template (HTML) for each action. But not only HTML specifies page''s design (view) but CSS and JS, also. Asset, in Rails terms. But can specify an asset for each action (by standard Rails'' mechanism, without dancing-with-bells :))? If not, I think it''s a good idea to have it - to have a possibillity to change the whole page''s design. Thanx. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/ofufv0nnQSEJ. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Jonathan Lozinski
2012-Aug-18 12:21 UTC
Re: Suggestion; a mechanism to specify asset path for controller (or specified actions)
Couldn''t this be simply achieved by using a layout which uses different CSS files? So Layout1 loads CSS/desktop.css Layout2 loads CSS/mobile.css For example Sent from my iPad On 18 Aug 2012, at 11:58, kuraga <kuraga333@mail.ru> wrote: Good day! Rails have *layout* method that allows you to specify a layout for controller or some it actions. So we can specify a template (HTML) for each action. But not only HTML specifies page''s design (view) but CSS and JS, also. Asset, in Rails terms. But can specify an asset for each action (by standard Rails'' mechanism, without dancing-with-bells :))? If not, I think it''s a good idea to have it - to have a possibillity to change the whole page''s design. Thanx. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/ofufv0nnQSEJ. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Alexander Kurakin
2012-Aug-18 12:29 UTC
Re: Suggestion; a mechanism to specify asset path for controller (or specified actions)
What about images? Ok, I said: it''s possible. Is it possible with relax? For layouts - possible. But for assets? суббота, 18 августа 2012 г., 16:21:32 UTC+4 пользователь mrloz написал:> > Couldn''t this be simply achieved by using a layout which uses different > CSS files? > > So > > Layout1 loads CSS/desktop.css > Layout2 loads CSS/mobile.css > > For example > > Sent from my iPad > > On 18 Aug 2012, at 11:58, kuraga <kura...@mail.ru <javascript:>> wrote: > > Good day! > > Rails have *layout* method that allows you to specify a layout for > controller or some it actions. So we can specify a template (HTML) for each > action. > > But not only HTML specifies page''s design (view) but CSS and JS, also. > Asset, in Rails terms. > > But can specify an asset for each action (by standard Rails'' mechanism, > without dancing-with-bells :))? If not, I think it''s a good idea to have it > - to have a possibillity to change the whole page''s design. > > Thanx. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-core/-/ofufv0nnQSEJ. > To post to this group, send email to rubyonra...@googlegroups.com<javascript:> > . > To unsubscribe from this group, send email to > rubyonrails-co...@googlegroups.com <javascript:>. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/9iy_lIhIx-4J. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Dennis Krupenik
2012-Aug-19 08:36 UTC
Re: Suggestion; a mechanism to specify asset path for controller (or specified actions)
> > asset for each action (by standard Rails'' mechanism, without > dancing-with-bells :))? If not, I think it''s a good idea to have it - to > have a possibillity to change the whole page''s design. >could you provide a specific example when you actually need separate assets? You could easily do theming with scss: <pre>$theme: ''winter''; @if ''halloween'' == $theme { body { background: #000; } a#logo { background: image-url(''logo_jason.png'') ;} } @else { body { background: #e9e9e9; } a#logo { background: image-url(''logo_default.png'') ;} } header { background: image-url(''themes/#{$theme}/header.jpg'') center top no-repeat; }</pre> or something like that. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/5aX00hP3OZQJ. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.