It''s called scoping. Imagine I have a logged in user, and they can
view a list of, say, posts. Post belongs to user which (almost
obviously) therefore has many posts. Then, we do this for the view:
@post = logged_in_user.posts.find(params[:id])
Blog: http://random8.zenunit.com/
Learn rails: http://sensei.zenunit.com/
On 04/02/2009, at 11:19 PM, Adriano Lul
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org
> wrote:
>
> Hi I want to do a simple create method and then it will open a view
> (show) to show all the data that was inputed (pretty simple).
> But I want the person to see the show ONLY when he/she first input his
> data (for example after the create it will redirect to show in
> localhost/anything/1 )
> But I dont want to be possible to ppl go to localhost/anything/1 and
> see
> other people data, is there a way to do it ?
> --
> Posted via http://www.ruby-forum.com/.
>
> >
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---