Hi Werner,

also das hier
:id => /\d+/
sagt, dass du nur "digits" erwartest, keine Buchstaben.
Also einfach den Regexp ändern...

Grüße,
        Michael.


On 01.10.2008, at 21:13, Werner Laude wrote:

routes:
map.listmovie 'movies/listmovie/:id', :controller => 'movies', :action => 'listmovie', :id => /\d+/





view:
<%= link_to '&raquo; &raquo;', listmovie_path(m.letter) %>

controller:
def listmovie
 @movies = Movie.find_by_first_letter(params[:id])

model:
def self.find_by_first_letter(letter)
    find(:all, :conditions => ['ucase(left(name, 1)) = ? ', letter])
end


link:
http://localhost:3001/movies/listmovie/a


bekomme immer:
No route matches "/listmovie/a" with {:method=>:get}
Muß ich die route irgendwie anders schreiben oder was ist da faul?
Movie.find(.all) klappt..
Danke für Hinweise.


_______________________________________________
rubyonrails-ug mailing list
[email protected]
http://mailman.headflash.com/mailman/listinfo/rubyonrails-ug

_______________________________________________
rubyonrails-ug mailing list
[email protected]
http://mailman.headflash.com/mailman/listinfo/rubyonrails-ug

Antwort per Email an