Application skinning/theme support with Rails (modified from Rails Recipe)
(please excuse me for writing in English, for there's no input method installed on client's machine.)
Rails provides a lightweight, CSS-driven approach to themes.
1. Add a String field called style to your application’s controller class, say UserController.
ruby 代码
- attr_accessor = style
-
- def initialize
- @style = 'default_style'
- end
2. Modify the app/views/layouts/user.rhtml like the following
xml 代码
- <html>
- <head>
- <%= stylesheet_link_tag(@style) %>
- </head>
- <body>
- ...
- </body>
- </html>
3. You can change the theme at runtime using code like the following
ruby 代码
- def authenticate
- ...
- @style = 'user_specific_style'
- end
Then style sheet be used will change to public/stylesheets/user_specific_style.css
分享到:
- 2007-05-22 16:16
- 浏览 1848
- 评论(0)
- 论坛回复 / 浏览 (0 / 2651)
- 查看更多
相关推荐
对于论文Real-time Skeletal Skinning with Optimized Centers of Rotation和Efficient Dynamic Skinning with Low-Rank Helper Bone Controllers的报告,里面的视频内容下载链接:...
• Skinning Framework with 35+ built-in themes and support for visual theme designer tool. • Extensive documentation. • Large, vibrant and active user community. • Developed with "passion" from ...
GPUSkinning学习
Lec 06 Basics of Computer Animation—Skinning/Enveloping Lec 07 Particle Systems and ODEs Lec 08 Particle Systems and ODE Solvers II, Mass Spring Modeling Assignment 2 Lec 09 Implicit Integration, ...
* Change the application’s appearance with styling and skinning * Use Flex components to add charts and graphs "Alaric and Elijah do a great job of guiding a newbie Flex developer through the ...
VGScene speeds the development of all graphical application, providing: a graphical editor integrated in IDE, graphical objects, simplify animation, advanced windows and controls, maximum performance,...
GPUSkinning.unitypackage
VGScene speeds the development of all graphical application, providing: a graphical editor integrated in IDE, graphical objects, simplify animation, advanced windows and controls, maximum performance,...
cegui Falagard_Skinning_System,详细介绍looknfeel的设计及使用。
ECS提升GpuSkinning.zip
Skinning Windows XP By Joe Habraken Pages : 336 有问题,我的QQ:571669275
The Skinning Contract – Skinning Spark Components Creating Spark components and skins Spark Components/Skins lifecycle New Layout Engine Existing Spark layouts Creating custom Spark layout New ...
AlphaControls 2017 -------------------- ... * Improved support of the SKININDESIGN key (coloring of frames at the design-time) * Showing of own hints for glyphs in ComboEdits implemented
Advanced skinning engine based on vector graphics styles. Cool exists styles - Dark, Modern, Vista. DXScene can be used to create hardware accelerated 2D applications with cool animation like Cover...
With AlphaControls, use a new modern way to design enhanced interfaces and make your application more attractive... while adding pleasure and fun to end users. Demonstration Programs ---------------...
With AlphaControls, use a new modern way to design enhanced interfaces and make your application more attractive... while adding pleasure and fun to end users. Demonstration Programs ---------------...
The Library contains skinning tool for Delphi 5/6/7/2005-2010/XE-XE8, C++ Builder 6/2006-2010/XE-XE8, RAD Studio 10 Seattle, RAD Studio 10.1 Berlin, RAD Studio 10.2 Tokyo AlphaControls :: history ...
With AlphaControls, use a new modern way to design enhanced interfaces and make your application more attractive... while adding pleasure and fun to end users. Demonstration Programs ----------------...
+ Added TsAlphaImageList component with support of Png glyphs with alphachannels and Ico32 * ThirdParty list is empty by default now (use handy editor with predefined values for changing this list) ...