Comments (15)
Hi, i solved the problem, the code was a "Post" but the routes were looking for a "Get". I just changed the post to get in the permission.rb file.
from active_admin_role.
You don't need to update the routes manually. The reload routing is defined by this lines.
Could you please check and run sample application?
https://github.com/yhirano55-playground/active_admin_role_sample
from active_admin_role.
The odd thing is it worked on my other device and I see those lines in my permissions.rb file.
here are my routes
Rails.application.routes.draw do
devise_for :admin_users, ActiveAdmin::Devise.config
ActiveAdmin.routes(self)
devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" }
resources :users do
resources :projects
end
devise_scope :user do
# get 'admin_user/registrations/new', to: 'active_admin/devise/registrations#new'
# post 'admin_user/registrations/new', to: 'active_admin/devise/registrations#new'
get '/users/:user_id/projects', to: 'projects#index', as: 'projects'
get '/users/:user_id/projects/new', to: 'projects#new', as: 'new_project'
post '/users/:user_id/projects/new', to: 'projects#new'
post '/users/:user_id/projects', to: 'projects#create'
get '/users/:user_id/projects/:id', to: 'projects#show', as: 'project'
get '/users/:user_id/projects/:id/edit', to: 'projects#edit', as: 'edit_project'
patch '/users/:user_id/projects/:id', to: 'projects#update'
put '/users/:user_id/projects/:id', to: 'projects#update'
delete '/users/:user_id/projects/:id', to: 'projects#destroy', as: 'delete_project'
get 'user_google_oauth2_omniauth_authorize_path', to: 'events#calendars', as: 'calendars'
get '/redirect', to: 'events#redirect', as: 'redirect'
get '/callback', to: 'events#callback', as: 'callback'
get '/events/:calendar_id', to: 'events#events', as: 'event', calendar_id: /[^\/]+/
post '/events/:calendar_id', to: 'events#new_event', as: 'new_event', calendar_id: /[^\/]+/
get 'tap_in', to: 'devise/sessions#new'
get 'genius_signup', to: 'devise/registrations#new'
get 'auth/google_oauth2/callback', to: 'users#create', as: 'google_signin'
delete 'signout', to: 'sessions#destroy', via: 'destroy'
post 'signout', to: 'classrooms#index'
#end
end
scope :api do
scope :v1 do
#resources :<controller_name>, except: [:new, :edit]
get 'api/v1/users' , to: 'registrations#create' , via: :post
end
end
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
resources :features,only: [:create]
resources :cohorts, only: [:create, :new, :index, :show]
resources :classrooms do
resources :attendances
collection do
post :search, to: 'classrooms#search'
end
end
resources :friendships, only: [:show, :create, :destroy] do
resources :messages, only: [:create]
end
root to: "classrooms#index"
mount ActionCable.server => '/cable'
#end
end
from active_admin_role.
Could you execute bin/rails routes
and copy and paste here?
from active_admin_role.
Prefix Verb URI Pattern Controller#Action
new_admin_user_session GET /admin/login(.:format) active_admin/devise/sessions#new
admin_user_session POST /admin/login(.:format) active_admin/devise/sessions#create
destroy_admin_user_session DELETE /admin/logout(.:format) active_admin/devise/sessions#destroy
new_admin_user_password GET /admin/password/new(.:format) active_admin/devise/passwords#new
edit_admin_user_password GET /admin/password/edit(.:format) active_admin/devise/passwords#edit
admin_user_password PATCH /admin/password(.:format) active_admin/devise/passwords#update
PUT /admin/password(.:format) active_admin/devise/passwords#update
POST /admin/password(.:format) active_admin/devise/passwords#create
admin_root GET /admin(.:format) admin/dashboard#index
batch_action_admin_schedules POST /admin/schedules/batch_action(.:format) admin/schedules#batch_action
admin_schedules GET /admin/schedules(.:format) admin/schedules#index
POST /admin/schedules(.:format) admin/schedules#create
new_admin_schedule GET /admin/schedules/new(.:format) admin/schedules#new
edit_admin_schedule GET /admin/schedules/:id/edit(.:format) admin/schedules#edit
admin_schedule GET /admin/schedules/:id(.:format) admin/schedules#show
PATCH /admin/schedules/:id(.:format) admin/schedules#update
PUT /admin/schedules/:id(.:format) admin/schedules#update
DELETE /admin/schedules/:id(.:format) admin/schedules#destroy
batch_action_admin_classrooms POST /admin/classrooms/batch_action(.:format) admin/classrooms#batch_action
admin_classrooms GET /admin/classrooms(.:format) admin/classrooms#index
POST /admin/classrooms(.:format) admin/classrooms#create
new_admin_classroom GET /admin/classrooms/new(.:format) admin/classrooms#new
edit_admin_classroom GET /admin/classrooms/:id/edit(.:format) admin/classrooms#edit
admin_classroom GET /admin/classrooms/:id(.:format) admin/classrooms#show
PATCH /admin/classrooms/:id(.:format) admin/classrooms#update
PUT /admin/classrooms/:id(.:format) admin/classrooms#update
DELETE /admin/classrooms/:id(.:format) admin/classrooms#destroy
admin_dashboard GET /admin/dashboard(.:format) admin/dashboard#index
batch_action_admin_events POST /admin/events/batch_action(.:format) admin/events#batch_action
admin_events GET /admin/events(.:format) admin/events#index
POST /admin/events(.:format) admin/events#create
new_admin_event GET /admin/events/new(.:format) admin/events#new
edit_admin_event GET /admin/events/:id/edit(.:format) admin/events#edit
admin_event GET /admin/events/:id(.:format) admin/events#show
PATCH /admin/events/:id(.:format) admin/events#update
PUT /admin/events/:id(.:format) admin/events#update
DELETE /admin/events/:id(.:format) admin/events#destroy
admin_event_calendar GET /admin/events/:event_id/calendar(.:format) admin/calendar#index
batch_action_admin_staffs POST /admin/staffs/batch_action(.:format) admin/staffs#batch_action
admin_staffs GET /admin/staffs(.:format) admin/staffs#index
POST /admin/staffs(.:format) admin/staffs#create
new_admin_staff GET /admin/staffs/new(.:format) admin/staffs#new
edit_admin_staff GET /admin/staffs/:id/edit(.:format) admin/staffs#edit
admin_staff GET /admin/staffs/:id(.:format) admin/staffs#show
PATCH /admin/staffs/:id(.:format) admin/staffs#update
PUT /admin/staffs/:id(.:format) admin/staffs#update
DELETE /admin/staffs/:id(.:format) admin/staffs#destroy
reload_admin_permissions POST /admin/permissions/reload(.:format) admin/permissions#reload
batch_action_admin_permissions POST /admin/permissions/batch_action(.:format) admin/permissions#batch_action
admin_permissions GET /admin/permissions(.:format) admin/permissions#index
batch_action_admin_genius POST /admin/genius/batch_action(.:format) admin/genius#batch_action
admin_genius GET /admin/genius(.:format) admin/genius#index
POST /admin/genius(.:format) admin/genius#create
new_admin_geniu GET /admin/genius/new(.:format) admin/genius#new
edit_admin_geniu GET /admin/genius/:id/edit(.:format) admin/genius#edit
admin_geniu GET /admin/genius/:id(.:format) admin/genius#show
PATCH /admin/genius/:id(.:format) admin/genius#update
PUT /admin/genius/:id(.:format) admin/genius#update
DELETE /admin/genius/:id(.:format) admin/genius#destroy
batch_action_admin_cohort_genius POST /admin/cohorts/:cohort_id/genius/batch_action(.:format) admin/genius#batch_action
admin_cohort_genius GET /admin/cohorts/:cohort_id/genius(.:format) admin/genius#index
POST /admin/cohorts/:cohort_id/genius(.:format) admin/genius#create
new_admin_cohort_geniu GET /admin/cohorts/:cohort_id/genius/new(.:format) admin/genius#new
edit_admin_cohort_geniu GET /admin/cohorts/:cohort_id/genius/:id/edit(.:format) admin/genius#edit
admin_cohort_geniu GET /admin/cohorts/:cohort_id/genius/:id(.:format) admin/genius#show
PATCH /admin/cohorts/:cohort_id/genius/:id(.:format) admin/genius#update
PUT /admin/cohorts/:cohort_id/genius/:id(.:format) admin/genius#update
DELETE /admin/cohorts/:cohort_id/genius/:id(.:format) admin/genius#destroy
batch_action_admin_attendances POST /admin/attendances/batch_action(.:format) admin/attendances#batch_action
admin_attendances GET /admin/attendances(.:format) admin/attendances#index
POST /admin/attendances(.:format) admin/attendances#create
new_admin_attendance GET /admin/attendances/new(.:format) admin/attendances#new
edit_admin_attendance GET /admin/attendances/:id/edit(.:format) admin/attendances#edit
admin_attendance GET /admin/attendances/:id(.:format) admin/attendances#show
PATCH /admin/attendances/:id(.:format) admin/attendances#update
PUT /admin/attendances/:id(.:format) admin/attendances#update
DELETE /admin/attendances/:id(.:format) admin/attendances#destroy
batch_action_admin_geniu_attendances POST /admin/genius/:geniu_id/attendances/batch_action(.:format) admin/attendances#batch_action
admin_geniu_attendances GET /admin/genius/:geniu_id/attendances(.:format) admin/attendances#index
POST /admin/genius/:geniu_id/attendances(.:format) admin/attendances#create
new_admin_geniu_attendance GET /admin/genius/:geniu_id/attendances/new(.:format) admin/attendances#new
edit_admin_geniu_attendance GET /admin/genius/:geniu_id/attendances/:id/edit(.:format) admin/attendances#edit
admin_geniu_attendance GET /admin/genius/:geniu_id/attendances/:id(.:format) admin/attendances#show
PATCH /admin/genius/:geniu_id/attendances/:id(.:format) admin/attendances#update
PUT /admin/genius/:geniu_id/attendances/:id(.:format) admin/attendances#update
DELETE /admin/genius/:geniu_id/attendances/:id(.:format) admin/attendances#destroy
sort_admin_cohorts POST /admin/cohorts/sort(.:format) admin/cohorts#sort
batch_action_admin_cohorts POST /admin/cohorts/batch_action(.:format) admin/cohorts#batch_action
admin_cohorts GET /admin/cohorts(.:format) admin/cohorts#index
POST /admin/cohorts(.:format) admin/cohorts#create
new_admin_cohort GET /admin/cohorts/new(.:format) admin/cohorts#new
edit_admin_cohort GET /admin/cohorts/:id/edit(.:format) admin/cohorts#edit
admin_cohort GET /admin/cohorts/:id(.:format) admin/cohorts#show
PATCH /admin/cohorts/:id(.:format) admin/cohorts#update
PUT /admin/cohorts/:id(.:format) admin/cohorts#update
DELETE /admin/cohorts/:id(.:format) admin/cohorts#destroy
admin_staffs_comments GET /admin/staffs_comments(.:format) admin/staffs_comments#index
POST /admin/staffs_comments(.:format) admin/staffs_comments#create
admin_staffs_comment GET /admin/staffs_comments/:id(.:format) admin/staffs_comments#show
DELETE /admin/staffs_comments/:id(.:format) admin/staffs_comments#destroy
new_user_session GET /users/sign_in(.:format) devise/sessions#new
user_session POST /users/sign_in(.:format) devise/sessions#create
destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy
user_google_oauth2_omniauth_authorize GET|POST /users/auth/google_oauth2(.:format) users/omniauth_callbacks#passthru
user_google_oauth2_omniauth_callback GET|POST /users/auth/google_oauth2/callback(.:format) users/omniauth_callbacks#google_oauth2
new_user_password GET /users/password/new(.:format) devise/passwords#new
edit_user_password GET /users/password/edit(.:format) devise/passwords#edit
user_password PATCH /users/password(.:format) devise/passwords#update
PUT /users/password(.:format) devise/passwords#update
POST /users/password(.:format) devise/passwords#create
cancel_user_registration GET /users/cancel(.:format) devise/registrations#cancel
new_user_registration GET /users/sign_up(.:format) devise/registrations#new
edit_user_registration GET /users/edit(.:format) devise/registrations#edit
user_registration PATCH /users(.:format) devise/registrations#update
PUT /users(.:format) devise/registrations#update
DELETE /users(.:format) devise/registrations#destroy
POST /users(.:format) devise/registrations#create
user_projects GET /users/:user_id/projects(.:format) projects#index
POST /users/:user_id/projects(.:format) projects#create
new_user_project GET /users/:user_id/projects/new(.:format) projects#new
edit_user_project GET /users/:user_id/projects/:id/edit(.:format) projects#edit
user_project GET /users/:user_id/projects/:id(.:format) projects#show
PATCH /users/:user_id/projects/:id(.:format) projects#update
PUT /users/:user_id/projects/:id(.:format) projects#update
DELETE /users/:user_id/projects/:id(.:format) projects#destroy
users GET /users(.:format) users#index
POST /users(.:format) users#create
new_user GET /users/new(.:format) users#new
edit_user GET /users/:id/edit(.:format) users#edit
user GET /users/:id(.:format) users#show
PATCH /users/:id(.:format) users#update
PUT /users/:id(.:format) users#update
DELETE /users/:id(.:format) users#destroy
admin_permissions_reload POST /admin/permissions/reload(.:format) admin/permissions#reload
projects GET /users/:user_id/projects(.:format) projects#index
new_project GET /users/:user_id/projects/new(.:format) projects#new
POST /users/:user_id/projects/new(.:format) projects#new
POST /users/:user_id/projects(.:format) projects#create
project GET /users/:user_id/projects/:id(.:format) projects#show
edit_project GET /users/:user_id/projects/:id/edit(.:format) projects#edit
PATCH /users/:user_id/projects/:id(.:format) projects#update
PUT /users/:user_id/projects/:id(.:format) projects#update
delete_project DELETE /users/:user_id/projects/:id(.:format) projects#destroy
calendars GET /user_google_oauth2_omniauth_authorize_path(.:format) events#calendars
redirect GET /redirect(.:format) events#redirect
callback GET /callback(.:format) events#callback
event GET /events/:calendar_id(.:format) events#events {:calendar_id=>/[^\/]+/}
new_event POST /events/:calendar_id(.:format) events#new_event {:calendar_id=>/[^\/]+/}
tap_in GET /tap_in(.:format) devise/sessions#new
genius_signup GET /genius_signup(.:format) devise/registrations#new
google_signin GET /auth/google_oauth2/callback(.:format) users#create
signout DELETE /signout(.:format) sessions#destroy
POST /signout(.:format) classrooms#index
features POST /features(.:format) features#create
cohorts GET /cohorts(.:format) cohorts#index
POST /cohorts(.:format) cohorts#create
new_cohort GET /cohorts/new(.:format) cohorts#new
cohort GET /cohorts/:id(.:format) cohorts#show
classroom_attendances GET /classrooms/:classroom_id/attendances(.:format) attendances#index
POST /classrooms/:classroom_id/attendances(.:format) attendances#create
new_classroom_attendance GET /classrooms/:classroom_id/attendances/new(.:format) attendances#new
edit_classroom_attendance GET /classrooms/:classroom_id/attendances/:id/edit(.:format) attendances#edit
classroom_attendance GET /classrooms/:classroom_id/attendances/:id(.:format) attendances#show
PATCH /classrooms/:classroom_id/attendances/:id(.:format) attendances#update
PUT /classrooms/:classroom_id/attendances/:id(.:format) attendances#update
DELETE /classrooms/:classroom_id/attendances/:id(.:format) attendances#destroy
search_classrooms POST /classrooms/search(.:format) classrooms#search
classrooms GET /classrooms(.:format) classrooms#index
POST /classrooms(.:format) classrooms#create
new_classroom GET /classrooms/new(.:format) classrooms#new
edit_classroom GET /classrooms/:id/edit(.:format) classrooms#edit
classroom GET /classrooms/:id(.:format) classrooms#show
PATCH /classrooms/:id(.:format) classrooms#update
PUT /classrooms/:id(.:format) classrooms#update
DELETE /classrooms/:id(.:format) classrooms#destroy
friendship_messages POST /friendships/:friendship_id/messages(.:format) messages#create
friendships POST /friendships(.:format) friendships#create
friendship GET /friendships/:id(.:format) friendships#show
DELETE /friendships/:id(.:format) friendships#destroy
root GET / classrooms#index
/cable #<ActionCable::Server::Base:0x00007fb10dee71e8 @mutex=#<Monitor:0x00007fb10dee71c0 @mon_owner=nil, @mon_count=0, @mon_mutex=#<Thread::Mutex:0x00007fb10dee7120>>, @pubsub=nil, @worker_pool=nil, @event_loop=nil, @remote_connections=nil>
page GET /*id
from active_admin_role.
This line is reload.
reload_admin_permissions POST /admin/permissions/reload(.:format)
Do you use rails-ujs or jquery-ujs? If you don't use these libraries, POST reload doesn't work with anchor tag.
from active_admin_role.
thank you for your quick response, i really appreciate it. My gem file is
source 'https://rubygems.org'
# Bundle edge Rails instead:
gem 'rails'
gem 'railties'
gem 'bundler', '>= 1.8.4'
# Use sqlite3 as the database for Active Record
#gem 'sqlite3'
gem 'pg', '0.21.0'
# Use Puma as the app server
gem 'puma', '~> 3.0'
# Use SCSS for stylesheets
gem 'sass-rails'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
#gem 'kaminari'
gem 'ffi', '1.9.18'
gem 'activeadmin'
gem 'active_admin_theme'
gem 'paperclip'
gem "active_admin-sortable_tree"
gem 'active_admin_importable'
gem 'inherited_resources', github: 'activeadmin/inherited_resources'
gem 'activeadmin_addons'
gem 'active_admin_datetimepicker'
gem 'active_admin_role'
gem 'active_admin-duplicatable'
gem 'responders', '~> 2.2'
#gem 'sinatra-google-auth'
gem 'google-api-client', require: 'google/apis/calendar_v3'
gem 'omniauth'
gem 'omniauth-google-oauth2', git: 'https://github.com/zquestz/omniauth-google-oauth2.git'
gem 'omniauth-oauth2'
gem 'activerecord-session_store'
gem 'figaro'
gem 'high_voltage', '~> 3.0.0'
# Use jquery as the JavaScript library
gem 'rails-assets-jquery', source: 'https://rails-assets.org'
gem 'rails-assets-datatables', source: 'https://rails-assets.org'
gem 'jquery-ui-rails'
gem 'jquery-rails'
gem 'bootstrap-datepicker-rails'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
gem 'activemodel'
gem 'activerecord'
gem 'actionpack'
gem "activesupport"
gem 'bcrypt', '~> 3.1.7'
gem 'font-awesome-sass'
gem 'bootstrap-sass'
gem 'devise'
gem 'cancancan'
gem 'd3-rails','4.1.0'
gem 'will_paginate-bootstrap', '~> 1.0.1'
gem 'cocoon'
gem 'rails_layout'
gem 'ransack', github: 'activerecord-hackery/ransack'
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platform: :mri
gem 'rspec-rails', '3.5.1'
end
group :development do
# Use Dotenv for environment variables
gem 'dotenv', '~> 2.2.1'
gem "better_errors"
gem "binding_of_caller"
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console'
gem 'listen', '~> 3.0.5'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
gem 'guard', '~>2.14.0'
gem 'guard-rspec', '~> 4.7.2'
gem 'guard-cucumber', '~> 2.1.2'
end
group :production do
# Use Capistrano for deployment
gem 'capistrano', '~> 3.6'
gem 'capistrano-rails', group: :development
end
group :test do
gem 'capybara', '2.7.1'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
from active_admin_role.
Thanks. jquery-rails
is installed. Could you please check jquery-ujs README ? If it isn't resolved, please ask anyone in Stack Overflow? Your problem is out of active_admin_role matters.
from active_admin_role.
Im not sure why you say it is out of active_admin_role purview?
from active_admin_role.
First, this issue is not the support center for beginners. Second, Your app information is not enough to understand correct situation. If you want to ask me any advice, please study Markdown syntax and provide more information.
from active_admin_role.
Ouch, so even if your gem isn't working, because im a beginner, im not entitled to make an issue? Wow...
from active_admin_role.
Sorry, please read active admin role's scripts at first. And if you can't resolve this problem, ask me again.
from active_admin_role.
@quietwar congrats👏
from active_admin_role.
razy people but my delete buttons aint working using rails 5.2
from active_admin_role.
Thanks for your reporting. I’ll wait your pull request to fix this problem🙋♂️
from active_admin_role.
Related Issues (15)
- Limited access to the dashboard HOT 6
- undefined local variable or method `role_changeable' under Passenger HOT 6
- undefined method `delete' for :ok:Symbol HOT 6
- Maintainer wanted HOT 12
- ActiveAdminRole without Devise HOT 7
- How do we change the table name for "active_admin_permissions" table from any configuration file?
- role localization
- active_admin_role can not work on rails (~> 7.0.0) was resolved to 7.0.0
- DSL Autoload issues on rails 7 HOT 1
- How can we check role for custom link ?
- Batch action of admin user view not displaying assign as staff and other default roles in Rails 7.
- uninitialized constant ActiveAdminRole::Dsl (NameError) HOT 4
- Batch Actions for Updating Users HOT 1
- trouble adding admin users from inside the app HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from active_admin_role.