pnhthuan pnhthuan - 1 year ago 60
Ruby Question

How to make a Rails application global?

Currently, I am working on a website using Ruby on Rails, the website has many small applications for example full calendar, chat session, user verification etc. I created a new application recently called Todo list which acts as a reminder very simple. It currently has its own page


How do I make it in such a way that instead of just appearing on the
page it shows up everywhere on the website? I have tried to
require 'todo_lists'
but I get the error:

"cannot load such file -- todo_lists"

I tried copying all the files into the layouts folder (a feeble attempt). That gives me:

"Missing templates ....."

I tried to render partial (Not sure how it works)

Again "Missing templates" or "no_load_to_path" error

If possible I want it to appear like that of a Facebook chat bar, the very least is call the same thing but on a different page.

Answer Source

You can create an ERB partial inside layouts/_sidebar.html.erb and then in your application.html.erb you render the partial with:

  <%= render 'layouts/sidebar' %>

This will make it appear in all the application (assuming you have only one main layout)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download