Ruby on Rails Saturday, February 9, 2019

Daniel,

On Sat, 9 Feb 2019 at 23:13, Daniel Toma <tomada36@gmail.com> wrote:
  I just can't think of how this would be done, and I was wondering if anyone had an idea.

While you could use ruby for this, a Javascript solution is going to be less heavy on the server. Simply define a class for blue and a class for red as follows in CSS:

.available { background-image("//location/of/green/image"); }
.taken { background-image("//location/of/red/image"); }
.na { background-image("//location/of/unavailable/image"}; }

Now that these are defined, you can set the class on submit using jquery's .addClass after removing the old one using .removeClass. Good luck, matey and let me know if you need further assistance.

--
If you wish to request my time, please do so using bit.ly/hd1AppointmentRequest.
Si vous voudrais faire connnaisance, allez a bit.ly/hd1AppointmentRequest.

Sent from my mobile device
Envoye de mon portable

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAP%2BbYWCA5V8pekvCyF09BJnxce8cZOBXqOJ352v%2BQ79NgusXmw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment