Hi. I couldn't find any solution to link to home page (to any controller is easy- by <%= link_to %> ) but to main page? BTW: I'm trying to link from 'module' (so I would like to link to www.my-page.com/ not to www.my-page.com/admin )
Hi!
That is easy. Look into config/routes.php. Change the the "page" into "admin" (second line) and you are happy.
Happy coding!
hmm... You've propably missunderstood me - I would like to create link to home page, so:
<%= link_to 'Homepage' %>
would not create sth like this:
<a href="www.my-site.com">Homepage</a>
But I would like to. It's propably hidden in another function, but I couldn't find it - eighter on wiki, or in url helper.
I'm not sure if I understand it correctly, but it the page controller is still your default controller, with index as the default action, then
$url_helper->link_to('Homepage')
.. should link to it.
And if you don’t want to use page_controller, but another controller as the default you can change that in routes.php.
Or do you want to include the domain name in the link? ( instead of just <a href="/"> ) Don't know how to do that.
@kkrzyzak AkActionController::urlFor is the final responsible of serving urls.
Whenever we generate a link from inside a module, we need to implicitly say if the link should point out of the module. to do yo, you can:
<% link_to 'Home', :controller => '/page' %>
and if you want to link back to the admin module from out a module you can
<% link_to 'Admin', :controller => 'admin/dashboard' %>
1 to 5 of 5