Last active
December 21, 2015 17:09
-
-
Save kmelkon/6338735 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_tag status_deal_path(deal), :remote => true, :class => "deals_status" do %> | |
<%= radio_button_tag :state, "won"+deal.id.to_s, deal.state == "won", :class => "toggle-btn-left toggle-btn", :value =>"won" %> | |
<%= label_tag 'state_won'+deal.id.to_s, "won", :class=>"btn" %> | |
<%= radio_button_tag :state, "lost"+deal.id.to_s, deal.state == 'lost', :class => "toggle-btn-center toggle-btn",:value => "lost" %> | |
<%= label_tag 'state_lost'+deal.id.to_s, "lost",:class=>"btn" %> | |
<%= radio_button_tag :state, "pending"+deal.id.to_s, deal.state == 'pending',:class => "toggle-btn-right toggle-btn", :value => "pending" %> | |
<%= label_tag 'state_pending'+deal.id.to_s, "pending", :class=>"btn" %> | |
<% end %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("body").on("change", "form :radio", function(){ | |
$(this).closest("form").submit(); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.deals-wrapper').append('<%= escape_javascript(render :partial => "deals/deal", :locals => {:deal => @deal}) %>'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form accept-charset="UTF-8" action="/deals/85/status" class="deals_status" data-remote="true" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value=""><input name="authenticity_token" type="hidden" value=""></div> | |
<input class="toggle-btn-left toggle-btn" id="state_won85" name="state" type="radio" value=""> | |
<label class="btn" for="state_won85">won</label> | |
<input class="toggle-btn-center toggle-btn" id="state_lost85" name="state" type="radio" value=""> | |
<label class="btn" for="state_lost85">lost</label> | |
<input class="toggle-btn-right toggle-btn" id="state_pending85" name="state" type="radio" value=""> | |
<label class="btn" for="state_pending85">pending</label> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment