Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8918207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:41:42+00:00 2026-06-15T05:41:42+00:00

I have a basic CMS and i’m hugely using cross-controller rendering within it. class

  • 0

I have a basic CMS and i’m hugely using cross-controller rendering within it.

class Index < E
  map '/'

  # some actions

  def ad
    @steroids = render_p('anabolic-steroids/ads/left-banner')
    # some logic
  end
end

Steroids class:

class Steroids < E
  map 'anabolic-steroids'

  # actions
end

View folder:

view/
  |
  - anabolic-steroids/
      |
      - ads/
          |
          - left-banner.erb
  # other templates

Everything works well, but now customer wants anabolic-steroids URL
to be renamed into steroids

To make this work i remapped Steroids class:

map :steroids

and renamed view/anabolic-steroids/ folder to view/steroids/.

And Steroids controller works well with new URL.

But now all other controllers that were rendering steroids ad are broken 🙁

And i have to find all places where it is used and rename

render_p('anabolic-steroids/ads/left-banner')

to

render_p('steroids/ads/left-banner')

Odd!

I have also other lot of places where i’m using cross-controller rendering like this.

Any way to avoid useless refactoring
when such innocent renaming requests comes from customers?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T05:41:43+00:00Added an answer on June 15, 2026 at 5:41 am

    Quite long description for a slightly trivial issue 🙂 (joking, sorry, good question though)

    The solution is simple, really simple – never use strings where you can use something else…

    Seems you missed this on documentation – “To render a template of inner controller, pass controller as first argument and the template as second.”

    See official docs here

    So to survive any renaming issues use cross-controller rendering like this:

    render_p(Steroids, 'ads/left-banner')
    

    Now you should not worry about “innocent renaming requests” 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a basic CMS for some news articles, basically some of my content
I have a CMS generating a basic navigation using a UL. Each first-level LI
I have created a basic CMS using CodeIgniter 2.0.3, and now I want to
I have some basic jquery code sitting in the header of the header file
I have a basic CMS in PHP/MySQL where content managers can create pages to
I have written a small CMS for an application which provides basic site management
I have a basic CMS where a user can update a database of articles
I am creating a basic CMS website using Alfresco Web Quick Start. I want
I'm in the process of writing a small/basic CMS system using Symfony 1.4 and
I have a basic cms that loads content into pages that have mustache tags

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.