Ruby on Rails Friday, March 8, 2019

On Fri, 8 Mar 2019 at 11:46, Robert Phillips
<robert.phillips37@gmail.com> wrote:
>
> Is it possible to reference welcome#index, in the routes file?
>
> e.g. suppose you create a rails program,
> so then you do ralsi server you get the welcome page come up.
> but the routes file is blank. The welcome controller hasn't been referenced explicitly.
>
> i'd like to reference it explicitly.
>
> Say I make a make a controller, add an action, and a view, and add a route for that controller. Now I get no welcome page (That 'yay' page rails shows).
>
> But suppose I want it to be that when the user goes to /abc, it shows that page.
>
> How can I do that, referencing the welcome controller explicitly? Is it possible?

You can reference any controller/action in the routes. Welcome#index
is no different to any other. Reference it exactly the same way as
you would reference any controller#action.

Also are you sure the routes file was empty initially? Was there not
a 'root:' element?

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtVtVYdaMa99q3RqVexxKpF3DS1gU_xPHuhR-15aZaEXg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment