RSSAmplifier

HYBRD Posts · Oct 15, 2021

A simple interface for the controller context in your Rails app

0
Sign in to vote or save

This site does not allow itself to be embedded. You can still read it on the original site — the toolbar below keeps your place in the directory.

Oftentimes in a Rails app, you namespace your controllers based on the context. Admin:: will namespace all your admin controllers, Members:: may namespace all the controllers in your members-only area. Have you ever needed to know the namespace context in your layout? Here’s a simple interface you can use: First, drop the following Namespace class into your lib folder. It’s going to determine the…

Read on hybrd.co

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.