I am trying to add some instance variables in helpers like the
following:

module ApplicationHelper
 def title=(title)
   @title = title
 end

 def title
  @title
 end
end

and when I assign title in views/pages/index.html.erb like the
following:

<% title = 'Listing Pages' %>

and try to show it in the views/layouts/application.html.erb like the
following:

<%= title %>

it is showing as '' and after some debugging, looks like @title is not
being set.

Why are the instance variables added in the helpers not available in the
views (templates)?

Thanks in advance.
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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