Created
May 23, 2016 00:26
-
-
Save nilbus/8c7ae6c95d1461d62ccbb4ee4a2e8c42 to your computer and use it in GitHub Desktop.
This file contains 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
def update | |
find_user | |
if @user.update_attributes(user_params) | |
respond_to do |format| | |
format.html { | |
redirect_to admin_user_path(@user) | |
flash[:notice] = 'User updated' | |
} | |
format.js { | |
} | |
end | |
else | |
render :edit | |
flash[:notice] = 'User not updated' | |
end | |
end |
This file contains 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
#contract-start.row{style: @user.approved ? '' : 'display:none'} | |
.col-md-12 | |
%table.table.table-condensed | |
%thead | |
%tr.text-uppercase | |
%th{:colspan => "4"} | |
contract information | |
%tbody | |
%tr | |
%td.text-left | |
Pro bono | |
%td.text-right | |
%ul.list-inline.nomb | |
%li | |
= form_for([:admin, @user], remote: true) do |f| | |
= hidden_field(:user, :pro_bono, value: true) | |
= f.button(class: "nob noba nolp norp", id: "approve-pro-bono") do | |
%i.glyphicon.glyphicon-ok.ml10.flat-green | |
%li | |
= form_for([:admin, @user], remote: true) do |f| | |
= hidden_field(:user, :pro_bono, value: false) | |
= f.button(class: "nob noba nolp norp", id: "approve-pro-bono") do | |
%i.glyphicon.glyphicon-remove.ml10.flat-red |
This file contains 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
- if params["user"]["approved"] | |
$("#contract-start").fadeIn(); | |
console.log("hello") | |
- if params["user"]["pro_bono"]["t"] | |
$(".is-pro-bono").fadeIn(); | |
- if params["user"]["pro_bono"]["f"] | |
$(".is-pro-bono").fadeOut(); | |
- if params["user"]["office_location"] | |
$("#office_location").fadeIn(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment