💎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
11
61
476
81
0
Probably easier to make two independently maintainable views than dealing with responsiveness
0
0
1
0
0
此推文已無法使用。
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
0
0
0
0
0
United States 趨勢
- 1. Klay 20.2K posts
- 2. #AEWFullGear 69.9K posts
- 3. McLaren 45.5K posts
- 4. Lando 98.4K posts
- 5. #LasVegasGP 184K posts
- 6. Ja Morant 8,889 posts
- 7. LAFC 15.4K posts
- 8. gambino 2,333 posts
- 9. Hangman 9,853 posts
- 10. Samoa Joe 4,734 posts
- 11. Swerve 6,356 posts
- 12. #Toonami 2,818 posts
- 13. Bryson Barnes N/A
- 14. Verstappen 79.4K posts
- 15. Utah 24K posts
- 16. Kimi 38.5K posts
- 17. Mark Briscoe 4,415 posts
- 18. Benavidez 15.9K posts
- 19. Terry Crews 7,710 posts
- 20. Fresno State 1,004 posts
Loading...
Something went wrong.
Something went wrong.