There is an open question here. From here those conditional methods are
coming from? From helpers modules? This will add a lot of this kind of
methods in the global namespace since helpers are global and will make code
harder to understand.

On Mon, Oct 24, 2016 at 10:12 PM <em...@leaplines.com> wrote:

> Heya,
>
> Setting condition classes is a huge pain in rails at the moment, or maybe
> i am missing it but i can't see to find it. borrowed from react components
> kind of style.
>
> I want something like this (the class selected is only added if the value
> is true)
>
> link_to("Homepage", root_path, class: {selected: selected?})
>
> -> a href class="selected" and other
>
> You can do the same thing to add multiple classes too
>
> link_to("Hello", root_path, class: {class: {btn:true, selected: selected?}}
>
> I think this would be awesome, anything reasons why we shouldn't implement
> this?
>
> Cheers,
>
> - Emile
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-core+unsubscr...@googlegroups.com.
> To post to this group, send email to rubyonrails-core@googlegroups.com.
> Visit this group at https://groups.google.com/group/rubyonrails-core.
> 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: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to