i have a bunch of users
each user has_one :user_option
user options contains info about how to handle the users data ,
preferences and such
what i would like to do in the summary page ( page after logging in )
is display a link with a message if the user has not created his row in
the options table.
would i use something like:
@flash[:message] = 'need to set up your account, dude'
render_partial blah blah blah
render_partial some link like 'edit my options' or whatever
Sort of, though you're mixing up the controller and view a little bit.
Although it's not a good idea to put much code in the view I'd probably
just do something like this in the view:
<% if user.option %>
<p><strong>need to set up your account, dude</strong></p> #nil will
evaluate as false so don't need explicit test for it
<%= render :partial => "setup_account" %> # assuming this is some
sort of setup form
<% else %>
<p><%= link_to "edit your account options", :action =>
<% end %>
There's lots of ways to do this, to be honest, but hopefully this will
get you started