Hartls Tutorial Section 3.4 rails generate controller error -


i'm following hartl's rails tutorial , when issue following command:

rails generate controller staticpages home --no-test-framework

it throws , error:

you should not use match method in router without specifying http method. (runtimeerror) if want expose action both , post, add via: [:get, :post] option. if want expose action get, use get in router: instead of: match "controller#action" do: "controller#action"

i using rails 2.1.0 , i'm wondering if creating problem? need change of syntax in route.rb file?

you should having route in routes.rb have not specified http method.

for example: photoscontroller show action, use:

match 'photos', to: 'photos#show', via: [:get, :post] 

i suggest use latest version of rails 4.x, if doing rails tutorial.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -