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
- 浏览 1880
- 评论(0)
- 论坛回复 / 浏览 (0 / 2677)
- 查看更多
相关推荐
对于论文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技术在Unity3D中的应用详解》 GPUSkinning,全称GPU骨骼动画,是一种在图形处理单元(GPU)上执行的角色皮肤和骨骼动画技术。相较于传统的CPU驱动的骨骼动画,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, ...
### 三、Skinning with Images 图像皮肤定制 #### Scale9 图像拉伸 - **概念**:一种图像拉伸技术,允许图像根据控件大小自动调整而不失真。 - **用途**:适用于按钮、边框等需要适应不同尺寸的控件。 #### 使用...
* 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,...
Flex Skinning机制是Adobe Flex框架中的一个重要特性,它允许开发者为UI组件自定义外观和行为,从而实现应用程序的独特设计和交互体验。通过深入理解并实践Flex Skinning,开发者可以更灵活地控制用户界面的视觉样式...
标题中的"ECS提升GpuSkinning"涉及到两个关键概念:ECS(Entity Component System)和GPU Skinning。在Unity游戏引擎中,ECS是一种优化性能的设计模式,而GPU Skinning是用于处理3D角色动画的技术。现在我们来深入...
GPUSkinning.unitypackage
### Falagard Skinning System for CEGUI 参考手册翻译 #### 一、Falagard Skinning System 概述 Falagard Skinning System 是 CEGUI (Component Entity GUI) 的一个核心组件,用于实现界面外观(或称为皮肤)的...
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 的设计与应用 #### 引言与概述 CEGUI(Client-Environment for Graphical User Interfaces)是一款强大的跨平台图形用户界面工具包,广泛应用于游戏开发...
Skinning Windows XP By Joe Habraken Pages : 336 有问题,我的QQ:571669275
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 ---------------...