> class ContactsController < ApplicationController
>   def index
>     �...@current_tab = 'Contact Us'
>   end
> end
>
> in a helper, probably application_helper.rb
>
> def tab_link(tab_name, target)
>    link_to(tab_name, target, :class => tab_name == @current_tab ?  
> 'current_tab' : 'jtab')
> end
>
Is it OK to get rig of @current_tab from controllers and modify above
tab_link method to look like following code?

def tab_link(tab_name, target)
   link_to(tab_name, target, :class => target ==
request.env['PATH_INFO'] ? 'active_tab': 'other_tab')
end

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to