0-30%
30-60%
60-90%
90-100%
get 'obtain', to: 'items/obtain'
get ':id/obtain', to: 'obtain'
member { get :obtain }
get '/items/1/obtain', to: 'items#obtain'
resources :items do
end
Assume @pokemon = Pokemon.new
post '/pokemons', to: 'pokemons#create', as: :pokemons
get '/pokemons/new', to: 'pokemons#new', as: :pokemons
patch '/pokemons', to: 'pokemons#create', as: :pokemons
post '/pokemons/new', to: 'pokemons#new', as: :new_pokemon
= simple_form_for @pokemon do |f| = f.input :name = f.button :submit
= simple_form_for @pokemon do |f| ...
= simple_form_for @pokemon, url: pokemons_path(@pokemon), method: :post do |f| ...
Post to pokemons_path (new resource) or patch to pokemon_path (updating resource) behind the scenes.
resources :pokemons does all this already!
We turn an idea into an app from start to finish!
For the future!
Visiting '/users' in the browser
User.create! name: 'Sam', email: 'sam@sam.com'
Quit.create text: ''
User.quits.create! text: 'I am a quitter.'