Ruby on Rails Sunday, December 27, 2015

On 27 December 2015 at 20:04, fugee ohu <fugee279@gmail.com> wrote:
> in my layout i wanna test if the user has a profile so when he clicks
> profile my app know whether to present him with a show + link to edit the
> exisiting profile, or just a form for new profile ~ thanks

How do you access the user's profile? If it is @user.profile (or
something similar) then @user.profile.nil? should do it.

Colin

>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/0a78ce5d-1e7c-4f26-8c63-f9691689e191%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLvqi9yqcrLGFYzfZsy%2B_Z7aWwri9ju5NrswiserH8FG3w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment