Roman Smelyansky
Roman Smelyansky

Reputation: 319

Ruby on rails button acting like checkbox

I am a real noob in RoR, and missing basic concepts of programming in it.

I created a table with 3 boolean fields and corresponding show/edit/delete etc.

I have, as default, checkboxes for changing/creating those boolean fields.

Q: I would like to create a button instead of checkbox, which acts like checkbox and in case of 'checked' or 'unchecked' it sets corresponding color/image on button.

Edit: For those who negged this - at least tell me whats wrong with the question if that's so trivial to you

Cheers Aledj

Upvotes: 0

Views: 576

Answers (2)

Roma149
Roma149

Reputation: 1431

It seems that you simply want to give the checkbox a different style. While this can be accomplished by writing the CSS directly, you might be better off using a front-end framework like Bootstrap or a jQuery-UI theme which will do it for you, with some pre-defined styles.

Bootstrap

jQuery UI Themes

Upvotes: 2

dewyze
dewyze

Reputation: 979

You can just use css to make most things look like most things:

CSS: styled a checkbox to look like a button, is there a hover?

Upvotes: 1

Related Questions