i strongly suggest you read about RESTful design and controllers in
Rails. You should find plenty of good tutorials on google.
I don’t know how you created the controller but it is usualy used in
plural. So if you create a model Item, the created controller is
called itemS_controller.rb. This means you should try accessing /items/
add_me (why add_me and not new?) rather than /item/add_me.
The line you wrote in the routes searches for any controller matching
first “parameter” in url and action second. I’m (almost) sure your
controller is in plural and this is the reason why the route doesn’t
work.
But you should consider making a custom route like this:
map.items “items/:action”, :controller => “items”
Then in your views you can easily make links like this:
<%= link_to ‘All items’, items_path %>
Hope it helps! And hey… find and read some tutorials on restful
design!
I try to add an item with custom params. I wrote my own action add_me
where i create an new item and filled it with this params (:title,
:description).
(Or should i call new and then update?)
The params comes from a loop over RSSReader posts, and add_me is to add
the rss content to my database.
If you can, pick the book “The Rails Way” by Obie F… I just
read this exact chapter last night and explains is super good detail,
exactly what you are wanting/trying to do.
He explains custom routes, named routes, etc. very well - along with
it being an excellent book in many other areas.