Application.rb

I have a signin method in my application.rb. Currently this is being
called by the active controller…ie, mysite.com/controlller/signin.
For this I have to have a view signin.rhtml. This is working fine, but
I have to have a signin view under each controller’s views. Also,
would there be a way to call this like mysite.com/signin so that you
don’t have to have a controller listed, and so that it can be
controller independent.

On 3 October 2006 18:51, dirtymafia wrote:

I have a signin method in my application.rb. Currently this is being
called by the active controller…ie, mysite.com/controlller/signin.
For this I have to have a view signin.rhtml. This is working fine, but
I have to have a signin view under each controller’s views. Also,
would there be a way to call this like mysite.com/signin so that you
don’t have to have a controller listed, and so that it can be
controller independent.

  1. Use shared partials (e.g. render :partial => ‘shared/signin’ in your
    view,
    where partial is stored in app/views/shared/_signin.rhtml)
  2. Use routes:
    map.connect ‘/signin’, :controller => ‘Account’, :action => ‘signin’

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs