let's say you have a method... def get_tweet @tweet = Tweet.find(params[:id]) end how do you tie an action to that that only kicks in for the edit, update, and destroy methods?

Question:let's say you have a method... def get_tweet @tweet = Tweet.find(params[:id]) end how do you tie an action to that that only kicks in for the edit, update, and destroy methods?

1.index, show, new, edit, create, update, destroy

2.code = tweet, :method => :delete url = /tweets/1

3. before_filter :get_tweet, :only => [:edit, :update, :destroy]

4.@tweet = Tweet.create(:status => params[:tweet][:status])


Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!