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, 2015 at 7:47 AM, Dmitry Shvetsov <[email protected]>
wrote:

> Hi,
> What is in your rake routes output? Do you have /courses route?
>
> On Saturday, March 14, 2015, Diego Algorta <[email protected]> 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 returning true even if (according to the docs) it should.
>>
>> I created a gist with a short debugging session where I think the problem
>> gets shown really clear:
>> https://gist.github.com/oboxodo/602e18250e6af77bc4d8
>>
>> In summary, I think something's going wrong with rails/rack's request
>> parsing and SCRIPT_NAME + PATH_INFO variables where the initial slash in
>> "/courses" is not being processed. but it's clearer if you look at the gist.
>>
>> Anyone having a similar issue?
>>
>> Thanks!
>> Diego
>>
>> --
>> 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 [email protected].
>> To post to this group, send email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/rubyonrails-talk/de113a14-abb3-43da-a17b-e96e36a87fa4%40googlegroups.com
>> <https://groups.google.com/d/msgid/rubyonrails-talk/de113a14-abb3-43da-a17b-e96e36a87fa4%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>  --
> 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 [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/CAHjeiYGPKbheC52M8YYRPHW8-6QBdAi2oTfUvyy%2B2Jz1EFkY0A%40mail.gmail.com
> <https://groups.google.com/d/msgid/rubyonrails-talk/CAHjeiYGPKbheC52M8YYRPHW8-6QBdAi2oTfUvyy%2B2Jz1EFkY0A%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAFKVRj_6foWpFUp2TZJgeYM6JbwOYc_2tXDJjd5%2BJYyMySNxeg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to