ruby - Setting default page for Controller in Rails -


in rails how set default page controller. in application have controller named "greet" have 2 actions "welcome" , "wishes". while calling welcome page "localhost:3000/greet/welcome" worked.

but requirement if didn't give action name controller "localhost:3000/greet", takes default page associated controller only. how in rails 4.2. tried make index action within greet controller. didn't work. can me solve problem ?

in routes.rb add line:

get '/greet' => 'greet#welcome' 

you must in folder view create folder greet , in folder have create file welcome.html.erb


Comments