you can use a before_filter to set the @id variable for every action that needs it, also can you change the name to @post_id ?