💎Rails tip💎 Did you know about template variants? Useful when you have let's say one view for admins and one for normal users. Or one for mobile and one for desktop (when the views are too different to just be responsive). #ruby #rails #rubyonrails

websebdev's tweet image. 💎Rails tip💎

Did you know about template variants? Useful when you have let's say one view for admins and one for normal users. Or one for mobile and one for desktop (when the views are too different to just be responsive).

#ruby #rails #rubyonrails

Woah, never knew this one 😳🔥


Probably easier to make two independently maintainable views than dealing with responsiveness


Such a nice feature! Well done @rails 👏🏾👏🏾


Wow, wish I knew that 10 years ago


此推文已無法使用。

You can also fallback to a catch-all for when there is no request.variant set. So you probably wouldn't have a users variant; you would likely just let your app render the catch-all show.html.erb template for normal users


United States 趨勢
Loading...

Something went wrong.


Something went wrong.