Re: [Rails] Problem with current_page? & request.url.

2015-03-14 Thread Vivek Sampara
current_page?(controller: params[:controller], action: params[:action]) is not a recommended way to check as params[:controller] and params[:action] are created during the action dispatch flow. what is the output for this ? current_page?(controller: 'courses', action: 'index') On Sat, Mar 14, 2

Re: [Rails] Problem with current_page? & request.url.

2015-03-13 Thread Dmitry Shvetsov
Hi, What is in your rake routes output? Do you have /courses route? On Saturday, March 14, 2015, Diego Algorta wrote: > Hi everyone. > > (Rails 4.1.x) > > I'm trying to add a css class in a view but only if > current_page?(courses_path) #=> true. The problem I'm having is that that > is never r

[Rails] Problem with current_page? & request.url.

2015-03-13 Thread Diego Algorta
Hi everyone. (Rails 4.1.x) I'm trying to add a css class in a view but only if current_page?(courses_path) #=> true. The problem I'm having is that that is never returning true even if (according to the docs) it should. I created a gist with a short debugging session where I think the problem