Socket
Book a DemoInstallSign in
Socket

layout_by_action

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

layout_by_action

0.0.2
bundlerRubygems
Version published
Maintainers
1
Created
Source

layout_by_action for Rails Controllers

You might want to specify layouts for individual actions in your controllers.

Add gem "layout_by_action" to your Gemfile to get this syntax:

class ExampleController < ApplicationController
  layout_by_action new: "company", show: "example"
end

You can set a default layout.

layout_by_action "default", new: "company", show: "example"

You can also specify an array of actions for any layout.

layout_by_action [:new, :edit] => "company", show: "example"

About

Extracted from a Rails project by @barelyknown :)

This gem is an answer to a popular question on Stack Overflow.

Contributing

  • Fork it
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create new Pull Request

FAQs

Package last updated on 28 Aug 2013

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.