Ruby on Rails Thursday, August 15, 2013

On Thu, Aug 15, 2013 at 8:43 AM, Rick Schmitty <lists@ruby-forum.com> wrote:

> I realize this means I will have to have a bunch of if/case/lookup
> statements sprinkled about the app to handle all of the switching of
> layouts/views/css/(potentially js). I'll also need some lookup for the

I've done a similar thing before, and no you don't have to sprinkle
client-choosing logic throughout your views. What we did, to enable
mobile-friendly views IF the client was on the mobile domain, was to
check the domain and, if it was the mobile one, simply prepend a
mobile-friendly dir onto the view path. That included the layout,
which specified the mobile version of the css. What you could do is
check the domain and prepend a client-specific dir. Very simple and
efficient, especially if you ONLY put in those dirs the things that
absolutely MUST change, while everything else remains the same and is
drawn from the common dir.

-Dave

--
Dave Aronson, the T. Rex of Codosaurus LLC,
secret-cleared freelance software developer
taking contracts in or near NoVa or remote.
See information at http://www.Codosaur.us/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAHxKQihJJgh3MdEA%2BKbU%2B6dJpq90c-OrwrZsbn-jhrZqKdUPTw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment