Avoind access to some views


#1

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 ?


#2

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 L.
<removed_email_address@domain.invalid