More stuff
This commit is contained in:
parent
aa2b22358a
commit
4faf3e36ab
4 changed files with 4 additions and 4 deletions
|
@ -78,7 +78,7 @@ ready = function() {
|
|||
$(flash_success).removeClass("hidden");
|
||||
$(errors).addClass("hidden");
|
||||
$(form)[0].reset();
|
||||
$('#transaction_creditor').select2('data', null);
|
||||
$('#transaction_creditor').select2('val', null);
|
||||
}).on("ajax:error", function(xhr, status, error) {
|
||||
$(errors).removeClass("hidden");
|
||||
$(panel_ul).empty();
|
||||
|
|
|
@ -11,7 +11,7 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
|
||||
def authenticate_user_or_client!
|
||||
current_user || current_client || head(:unauthorized)
|
||||
current_user || current_client || redirect_to(root_path, flash: { notice: "You have been redirected." })
|
||||
end
|
||||
|
||||
def current_client
|
||||
|
|
|
@ -7,7 +7,7 @@ class UsersController < ApplicationController
|
|||
load_and_authorize_resource except: :show
|
||||
|
||||
def show
|
||||
@user = User.find_by_name(params[:id]) || User.new
|
||||
@user = User.find_or_create_by(name: params[:id])
|
||||
respond_to do |format|
|
||||
format.html { @transaction = Transaction.new }
|
||||
format.json { render json: @user }
|
||||
|
|
|
@ -14,5 +14,5 @@
|
|||
%span.glyphicon.glyphicon-euro
|
||||
= f.number_field :euros, value: amount(@transaction.amount),
|
||||
placeholder: "Bedrag", step: 0.01, min: (0.01 unless current_user.penning),
|
||||
class: "form-control", size: 20, required: true
|
||||
class: "form-control", size: 20, max: 100, required: true
|
||||
= f.submit "Send it!", class: "pure-button pure-button-primary btn"
|
||||
|
|
Loading…
Reference in a new issue