Can you pass data when you render :action

how can i do:
render :action => “headline”, :id => @user.id

Thanks,
Ben L.

sorry, that’s user_id, not :user_id (in the partial)

render :action => “headline”, :locals => {:user_id =>
@user.id}http://user.id/

and then it will be accessible via :user_id in the partial
http://api.rubyonrails.org/classes/ActionController/Base.html#M000206

ed

render :action => ‘headline’ does not actually run the headline
method. You need to run it explicitly:

def other_action
@user = User.find(params[:id])
headline
render :action => ‘headline’
end

def headline

you can access @user in here

end

AFAIK … but I haven’t done this in a while so things may have
changed.

-Jonathan.

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