You are here

layouts

Choosing Layouts at Runtime in Ruby on Rails - iPhone Safari x Firefox or IE on a PC

I wanted to set a different layout in my application depending on a decision of a special situation. For example, if the client system is a browser on an iPhone I'd like to show a different layout than a Firefox running in a PC.

I found inspiration on the official RoR documentation, specifically on the page about the rendering mechanism. Here is the code I wrote to display a specific layout if the client browser is a Safari running in a iPhone or iPod touch.

Subscribe to RSS - layouts