Layouts

Hi guys, can someone tell me why I can’t use routes like “user_path” in
custom layouts like ‘user-layout.html.erb’ ???

Thanks & regards.

does the route exist? what is the error you get?

try rake routes to see if user_path exists.

Yes, I’m trying all the routes and no one works. It says ‘cannot find
user_path’. These are the routes that I have.

user GET /users/:id(.:format) users#show
PATCH /users/:id(.:format) users#update
PUT /users/:id(.:format) users#update
DELETE /users/:id(.:format) users#destroy

In the application.layout those routes are working, I have to specify
any
special route tu use a different layout?.

Thanks

El miércoles, 7 de mayo de 2014 12:40:28 UTC+2, Gitted escribió:

No. In case that would be the problem I could use any other route but
that is not the case. I cannot use any other route in the custom
layout…

El 07/05/2014, a las 12:50, bertly_the_coder [email protected]
escribi:

it’s users_path

I would use “pry” for this case.
“binding.pry” in user-layout.html.erb and find out what is the problem

Yes sure.
‘layouts/user-layout.html.erb’

<%= link_to 'Log out', user_path , method: :delete %>

I have a few more layouts and it does not work neither. But it does in
‘application.html.erb’. I think that some route configuration have to be
set before this but I don´t know what.

Thanks

El miércoles, 7 de mayo de 2014 12:58:15 UTC+2, bertly_the_coder
escribió:

I don’t know what exactly is that… But have to be an easier way to fix
this.

El miércoles, 7 de mayo de 2014 13:06:50 UTC+2, Michael Lutsiuk
escribió:

How exactly are you trying to use the routes? Do you have some code you
could share?

Ok I don´t know what I did but now it works… :frowning: so sorry

El miércoles, 7 de mayo de 2014 13:10:50 UTC+2, Alfredo B.
escribió:

Ok, I will take a look on it. Thanks.

Could you please take a look at my other post related with Ajax
functionality please?.

Thanks & regards.

Alfredo.

El 07/05/2014, a las 13:19, Colin L. [email protected] escribi:

Hi guys
Firstly rake routes on console , check existing path is available.
Not
available then need define path in route file

On 7 May 2014 12:10, Alfredo B. [email protected] wrote:

I don’t know what exactly is that… But have to be an easier way to fix
this.

Using a debugger is sometimes the right way to find problems. Learn
how to use it and you will save a lot of time in the long run.

Colin

On 20 May 2014 03:57, Duong vong veasna [email protected] wrote:

Hi guys
I have problem when i try to link to my new page, can any one help me.

thanks and regard.

get “link/home”
get “link/about”

Probably someone will help if you describe the problem. Also I am not
sure what this has to do with the subject of the thread (Layouts). If
it is not a follow on from the previous post please start a new
thread.

Colin

Hi guys
I have problem when i try to link to my new page, can any one help me.

thanks and regard.

get “link/home”
get “link/about”