I have an app in which users and groups are linked by a many-to-many relationship.
I have a join table GroupUsers, and I would like to enable an user to add or remove a group from his directly in the group index, which is displayed as a table.
To add a group, I have added a form in one of the column of the index that creates a GroupUser entity. The problem is, I would like to use a Bootstrap icon-plus-sign to submit the form (the user_id and group_id are in hidden fields).
My column looks like this (in slim, .
is substitute for class=
in HTML parts) :
td
= form_for @item, as: :group_user, url: "groups/#{group.id}/users" do |f|
= f.hidden_field :user_id, :value => current_user.id
= f.hidden_field :group_id, :value => group.id
.form-actions
= f.submit '' do
i.icon-plus-sign.icon.icon-large
For the moment, instead of only a plus sign I get an empty button in the table, what shall I do ?
PS: I've checked this answer: Add icon to submit button in twitter bootstrap 2, which includes a bootstrap icon inside the button, but I want to have the icon instead of the button.