I have created a message posting feature using ruby the problem I now have is the function editing the post is available but it is accessible by ever single user no matter who posted the original post. How can I make it so the edit 'link' is only viewable or accessible or usable by the original poster. If any code is required please ask, thanks.
This is the error I get now:
undefined local variable or method `current_user' for #<ActionView::Base:0x4cdbb48>
Extracted source (around line #7):
4: <dd>
5: <%= car.name %><br />
6: <%= car.description %><br />
7: <%= link_to('edit', edit_post_path(@car)) if current_user.cars.include?(@car) %>
8: <%= link_to "Delete",
9: :controller => :car,
10: :action => :delete,