Thursday, April 5, 2012

[Rails] passing value from controller to view

 require "rubygems"
 require "twitter"

def login

Twitter.configure do |config|
         config.consumer_key = ''
         config.consumer_secret =  ''
         config.oauth_token = ''
         config.oauth_token_secret = ''
      end

 @client = Twitter::Client.new
end


In my tweet.html.erb

<% @client.home_timeline.each do |tweet| %>
 
&nbsp; <%= tweet.user[:screen_name] %>&nbsp;<br/>
<%= tweet.text %><br/>

<% end %>



Here i got the undefined method `home_timeline' for nil:NilClass, Why cannot access that @client in view from controller?

Thankyou
vishnu



--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/V9EPNc9lZxcJ.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate