New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rlayout

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rlayout

  • 0.5.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Rails Layout Extension, release 0.5.1 (Mar. 2009)

Feature

  1. simplifying content_for usage by extracting key/value pair from content_for data like YAML and setting them as content_for variables ��content_for��ʹ�ã���������YAML��key/value��ʽ����content_for����
  2. let erb file can determine layout by changing the default behavior of layout determining, just like java's sitemesh ͨ���ı�Ĭ�ϵ�layout��ȡ��ʽ��ʹerbҲ���Զ���layout������java��sitemesh
  3. use controller method if helper method requested from erb not exists ERB����helper�ķ��������ڣ����Զ�����controller�ķ���
  4. support theme template for field tag ֧��field tag������ģ��

Setup

  1. rlayout as gem put the following line into your rails initializer, or bottom of environment.rb ���������д���ӵ�rails��initializer�����environment.rb����� require 'rlayout'

  2. rlayout as plugin nothing need to do ����Ҫ��ʲô��

Usage

  1. simplifying content_for

<% content_for :config do %> title: This is my title panel: This is my panel <% end %>

that will do the same thing as the following:

<%- content_for :title do -%> This is my title <%- end -%> <%- content_for :panel do -%> This is my panel <%- end -%>

  1. determining layout in erb file <% content_for :config do %> #note��key layout won't be transferred to a content_for variable, it is only used to determine a view layout layout: happy <% end %>

  2. use theme template of field tag

class YourController form_theme :xhtml end

and see related code in folder "example/templates", the theme can be defined in tag with :theme, that will override theme definition in controller

Copyright (c) 2008 Leon Li, released under the MIT license

FAQs

Package last updated on 25 Jul 2009

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc