Routes with params


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!

Hey, thanks for your reply.

I think i dont make clear what i want to do :slight_smile:

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.

greetings :slight_smile: