on 2014-06-16 03:40
on 2014-06-16 04:23
On Sun, Jun 15, 2014 at 6:40 PM, Damián M. González <email@example.com> wrote: > I have 2 actions by a controller. There's an active layout for > both(application.html.erb). There's two HTML elements defined in the > layout which I want to be collored diferently if one action is called or > the another. Why not just define CSS classes for the two styles in a common style sheet and set an instance variable in the controller to pass to the view? e.g. <div class="<%= @actionclass %>"> ... </div> I can imagine other approaches, but that seems simplest. FWIW, -- Hassan Schroeder ------------------------ firstname.lastname@example.org http://about.me/hassanschroeder twitter: @hassan
on 2014-06-16 04:35
Yes Hassan that's a big better solution than the JS one, you opened my mind, I appreciate it, thanks. Still I'm open to receive other suggestions of ways to do this, for the sake of learn.