On 7/12/05, eoghan <rails-JPH02XhdevJeoWH0uzbU5w@public.gmane.org>
wrote:> Hello
> Im new to rails and Ive been going through Curts article on OnLamp...
> So I wanted to use map.connect in my routes file to point to /recipe/
> list (in case anyones familiar with the article)... So anyway I think
> its choking because the list.rhtml contains id''s... Ive copied the
> error I get below... Im using apache2 with rails (0.11.1) and ruby
> 1.8.2.
>
> in my routes.rb:
> map.connect '''', :controller =>
''recipe'', :action => ''list'', :title =>
> ''Welcome''
>
> Error:
> ActionController::RoutingError in Recipe#list
> Showing /recipe/list.rhtml where line #18 raised Generation failure:
> No route for url_options
> {:id=>1, :controller=>"recipe",
:action=>"show"}, defaults:
> {:controller=>"recipe", :title=>"Welcome",
:action=>"list"}
>
> 15:
> 16: <% @recipes.each do |recipe| %>
> 17: <tr>
> 18: <td><%= link_to recipe.title, :action =>
"show", :id =>
> recipe.id %></td>
> 19: <td><%= recipe.category.name %></td>
> 20: <td><%= textilize(recipe.description) %></td>
> 21: <td><%= recipe.date %></td>
You actually need something to connect to. Try something like:
map.connect '':controller/:action/:id'', :controller =>
''recipe'',
:action => ''list'', :title =>
''Welcome'', :id => nil
--
rick
http://techno-weenie.net