I want to get some lines printed in irb opened through rails console. I have seen a lot of SO questions of how to achieve it. But I get nothing in the irb.
below is the code--
def show
puts 'in show method'
@post = Feed.find_by_id params[:id]
puts @post.inspect
redirect_to root_path unless @post.present?
end
now I have opened server by command rails server
. Also, In another terminal I gave the command rails console
, it opened the irb prompt. when in browser I run localhost:3000/posts/82
it gives the correct post, but nothing is shown in the console. What step am I missing? I want to print something in the console when a particular method is called.