Skip to content

Instantly share code, notes, and snippets.

@dawidof
Last active May 29, 2016 18:29
Show Gist options
  • Save dawidof/faa130025cd01a3ee9b6a2411a7b9f5d to your computer and use it in GitHub Desktop.
Save dawidof/faa130025cd01a3ee9b6a2411a7b9f5d to your computer and use it in GitHub Desktop.
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
before_action :authenticate_user!, :except => [:index, :about, :contact, :faq]
before_action :configure_permitted_parameters, if: :devise_controller?
protected
def configure_permitted_parameters
devise_parameter_sanitizer.permit(:sign_up, keys: [:username])
end
def after_sign_in_path_for(resource)
admin_root_path
end
end
Started POST "/users/sign_in" for 127.0.0.1 at 2016-05-29 21:25:22 +0300
Processing by Devise::SessionsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"c9ZNc55D6+A0O2grI9iAkB4zcrFuA/Gl15ePKlCELw/ljXlrigN0/jKL9p4I+CsTB3GfSqUXTuHXYEuySunk4Q==", "user"=>{"email"=>"dawidof@mail.ru", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Sign in"}
User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."email" = ? ORDER BY "users"."id" ASC LIMIT ? [["email", "dawidof@mail.ru"], ["LIMIT", 1]]
(0.1ms) begin transaction
SQL (1.1ms) UPDATE "users" SET "current_sign_in_at" = ?, "last_sign_in_at" = ?, "sign_in_count" = ?, "updated_at" = ? WHERE "users"."id" = ? [["current_sign_in_at", 2016-05-29 18:25:22 UTC], ["last_sign_in_at", 2016-05-29 18:13:34 UTC], ["sign_in_count", 6], ["updated_at", 2016-05-29 18:25:22 UTC], ["id", 1]]
(0.9ms) commit transaction
Redirected to http://localhost:3000/admin
Completed 302 Found in 185ms (ActiveRecord: 2.7ms)
Started GET "/admin" for 127.0.0.1 at 2016-05-29 21:25:22 +0300
Processing by Admin::ApplicationController#index as HTML
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT ? [["id", 1], ["LIMIT", 1]]
Rendering admin/application/index.html.erb within layouts/application
Rendered admin/application/index.html.erb within layouts/application (217.9ms)
Completed 500 Internal Server Error in 227ms (ActiveRecord: 0.3ms)
ActionView::Template::Error (undefined local variable or method `admin_users_path' for #<#<Class:0x007ff09acff368>:0x007ff09acfc618>
Did you mean? admin_root_path):
10: <div class="col-md-3">
11: <h2>Admin Links</h2>
12: <ul class="nav nav-stacked">
13: <li><%= link_to "Users", admin_users_path %></li>
14: <li><%= link_to "Home Page", root_path %></li>
15: </ul>
16: </div>
app/views/admin/application/index.html.erb:13:in `_app_views_admin_application_index_html_erb___4523770763820209107_70335727961300'
Rendering /Users/dawidof/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0.rc1/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb within rescues/layout
Rendering /Users/dawidof/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0.rc1/lib/action_dispatch/middleware/templates/rescues/_source.html.erb
Rendered /Users/dawidof/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0.rc1/lib/action_dispatch/middleware/templates/rescues/_source.html.erb (3.9ms)
Rendering /Users/dawidof/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0.rc1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
Rendered /Users/dawidof/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0.rc1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.9ms)
Rendering /Users/dawidof/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0.rc1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb
Rendered /Users/dawidof/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0.rc1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (0.9ms)
Rendered /Users/dawidof/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0.rc1/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb within rescues/layout (65.4ms)
Rendering /Users/dawidof/.rvm/gems/ruby-2.3.1/gems/web-console-3.1.1/lib/web_console/templates/index.html.erb
Rendered /Users/dawidof/.rvm/gems/ruby-2.3.1/gems/web-console-3.1.1/lib/web_console/templates/_markup.html.erb (0.6ms)
Rendering /Users/dawidof/.rvm/gems/ruby-2.3.1/gems/web-console-3.1.1/lib/web_console/templates/console.js.erb within layouts/javascript
Rendering /Users/dawidof/.rvm/gems/ruby-2.3.1/gems/web-console-3.1.1/lib/web_console/templates/_inner_console_markup.html.erb within layouts/inlined_string
Rendered /Users/dawidof/.rvm/gems/ruby-2.3.1/gems/web-console-3.1.1/lib/web_console/templates/_inner_console_markup.html.erb within layouts/inlined_string (0.4ms)
Rendering /Users/dawidof/.rvm/gems/ruby-2.3.1/gems/web-console-3.1.1/lib/web_console/templates/_prompt_box_markup.html.erb within layouts/inlined_string
Rendered /Users/dawidof/.rvm/gems/ruby-2.3.1/gems/web-console-3.1.1/lib/web_console/templates/_prompt_box_markup.html.erb within layouts/inlined_string (0.6ms)
Rendering /Users/dawidof/.rvm/gems/ruby-2.3.1/gems/web-console-3.1.1/lib/web_console/templates/style.css.erb within layouts/inlined_string
Rendered /Users/dawidof/.rvm/gems/ruby-2.3.1/gems/web-console-3.1.1/lib/web_console/templates/style.css.erb within layouts/inlined_string (0.4ms)
Rendered /Users/dawidof/.rvm/gems/ruby-2.3.1/gems/web-console-3.1.1/lib/web_console/templates/console.js.erb within layouts/javascript (60.8ms)
Rendering /Users/dawidof/.rvm/gems/ruby-2.3.1/gems/web-console-3.1.1/lib/web_console/templates/main.js.erb within layouts/javascript
Rendered /Users/dawidof/.rvm/gems/ruby-2.3.1/gems/web-console-3.1.1/lib/web_console/templates/main.js.erb within layouts/javascript (0.3ms)
Rendered /Users/dawidof/.rvm/gems/ruby-2.3.1/gems/web-console-3.1.1/lib/web_console/templates/index.html.erb (107.2ms)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment