Skip to content

Commit

Permalink
cambio de autorizacion del metodo al crear #18
Browse files Browse the repository at this point in the history
  • Loading branch information
juanjcsr committed May 30, 2014
1 parent 4a5ce62 commit e953ffb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class ApplicationController < ActionController::Base
protect_from_forgery with: :null_session, if: Proc.new { |c| c.request.format == 'application/json' }

rescue_from CanCan::AccessDenied do |ex|
puts ex.message
redirect_to root_url, :alert => ex.message
end

Expand Down
6 changes: 4 additions & 2 deletions app/controllers/eventos_controller.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
require "net/http"
class EventosController < ApplicationController
before_action :set_evento, only: [:show, :edit, :update, :destroy]

load_and_authorize_resource
skip_authorize_resource :only => :create
before_action :authenticate_user!, only: [:edit, :new]
before_action :verified_request?


# GET /eventos
# GET /eventos.json
Expand Down Expand Up @@ -53,6 +54,7 @@ def create
format.html { render action: 'new' }
format.json do
puts @evento.errors
puts "LALALAL"
render json: @evento.errors, status: :unprocessable_entity
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/insertar.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
"latitud" => $objeto["latitud"],
"longitud" => $objeto["longitud"],
"pagina" => $objeto["pagina"],
"contato" => $objeto["contacto"],
"contacto" => $objeto["contacto"],
"precio" => $objeto["precio"]
));
$args = json_encode($args);
Expand Down

0 comments on commit e953ffb

Please sign in to comment.