「about」を「abouts/1」にルーティングしたい
私はこれを試しました:
match 'about' => 'abouts#show/1', :via => get
そしてそれはうまくいきません。何か案は?
「about」を「abouts/1」にルーティングしたい
私はこれを試しました:
match 'about' => 'abouts#show/1', :via => get
そしてそれはうまくいきません。何か案は?
What about just removing the 1 from the route and retrieve the record you want directly in the controller method?
# routes.rb
match 'about' => 'abouts#show', :via => get
# abouts_controller.rb
def show
@about = About.find(1)
end
どうですか:
match 'about' => 'abouts#show', :via => :get, :defaults => {:id => 1}