I believe you can open the pull request, after all the core team only says yes or no after seeing the code :/
> On 8 Nov 2016, at 22:06, em...@leaplines.com wrote: > > The question im asking is only about conditions doing of classes when things > are true in the hash. My `selected?` etc whatever are just examples. The > logic im describing is like gabriels. below. > > Op dinsdag 25 oktober 2016 16:08:55 UTC+2 schreef Rafael Mendonça França: > 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 <javascript:>> 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-co...@googlegroups.com <javascript:>. > To post to this group, send email to rubyonra...@googlegroups.com > <javascript:>. > Visit this group at https://groups.google.com/group/rubyonrails-core > <https://groups.google.com/group/rubyonrails-core>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. > > -- > You received this message because you are subscribed to a topic in the Google > Groups "Ruby on Rails: Core" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/rubyonrails-core/GtAQDk0SCA0/unsubscribe > <https://groups.google.com/d/topic/rubyonrails-core/GtAQDk0SCA0/unsubscribe>. > To unsubscribe from this group and all its topics, send an email to > rubyonrails-core+unsubscr...@googlegroups.com > <mailto:rubyonrails-core+unsubscr...@googlegroups.com>. > To post to this group, send email to rubyonrails-core@googlegroups.com > <mailto:rubyonrails-core@googlegroups.com>. > Visit this group at https://groups.google.com/group/rubyonrails-core > <https://groups.google.com/group/rubyonrails-core>. > For more options, visit https://groups.google.com/d/optout > <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.