On 6 April 2012 07:45, amvis <[email protected]> wrote:
>  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?

You can access it ok, it is just that it is nil.  Is the login method
being called in the action where you are seeing the problem?  Debug
into your action to check if necessary.  Have a look at the Rails
Guide on Debugging to find how to do this.

Colin

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