The Administrate gem is a library created by Thoughtbot for creating flexible, powerful admin dashboards in Rails.
Questions tagged [administrate]
47 questions
5
votes
0 answers
Scope dropdown options to current_user in Rails Administrate
When editing a form with Thoughtbot's Administrate gem, the dropdown options for a select field or HasMany relationship always display all possible records for a given Model/Association.
However I would only like to display records that are…

Branksy
- 101
- 6
4
votes
1 answer
Rails Administrate: Cannot customise controller actions
I'm using Rails Administrate and want to override the new action on a controller. The documentation suggests this is straightforward. However, the application seems to ignore my override and goes straight to rendering new.html.erb instead of going…

sebbecker
- 93
- 5
4
votes
1 answer
Unpermitted parameter error when adding request parameter while using Administrate
I'm using Administrate v0.11.0 with search_term textbox,
it works totally fine,
and now I want to add a request parameter my_search_condition_flag which is a boolean flag value that affects search condition.
In my index action of controller,
I added…

Hirofumi Okino
- 975
- 1
- 10
- 22
4
votes
2 answers
Rails. Create Devise users directly from Administrate panel
I'm using devise to create users directly from console, in consequence not using the :registerable module.
The way to create users from the console is by providing email, password and password_conformation this way:
User.create(email:…

Ernesto G
- 525
- 6
- 20
3
votes
2 answers
Show Administrate Attribute in One Area But Not In Another
I'm creating a Learning Management System. I've got Users enrolled in Courses. I'd like to show when a User has completed a course on the Users Show page. Like this:
If I add the complete Attribute in app/dashboards/course_dashboard.rb under…

Brad West
- 943
- 7
- 19
3
votes
1 answer
Rails Administrate - Customize has_many
I am working with the administrate gem. I have a collection of users and am showing a has_many relationship in that user dashboard.
Right now, my user_dashboard looks like
class UserDashboard < Administrate::BaseDashboard
# ATTRIBUTE_TYPES
# a…

James N
- 523
- 1
- 8
- 30
3
votes
1 answer
rails administrate with cancancan
Im using rails administrate for my application, but I want to limit access via the administrate dashboard to the resources being administered.
Im also using cancancan in the other parts of my rails app to manage access and permissions.
Has anyone…

Mohith Thimmaiah
- 93
- 1
- 6
2
votes
0 answers
Delete Functionality with span tag and link_to is not working. It goes to show action instead of destroy - Administrate 0.16.0 and rails 6.1
I am using Administrate gem version 0.16.0 and my Rails version is 6.1.3.1
In the listing of my records, I have a trash icon on click of which record should be deleted. But somehow it sends a GET request and goes into show action of the controller…

Pratha
- 61
- 4
2
votes
1 answer
Administrate gem — Pass custom HTML classes into fields
I use Rails 7, Ruby 2.7, the administrate gem for my admin dashboard and tailwindcss for the frontend.
I am trying to pass custom HTML classes into the fields. I have already generated the partials for all field types using the command rails…

Gabriel Guérin
- 430
- 2
- 13
2
votes
2 answers
How to Setup ActionText in Administrate (Rails 6.1)
I'm trying to set up Action Text inside an Administrate Dashboard. I've followed the installation steps on the Rails Guides Overview page. Then when trying to add the attribute to /app/dashboards/lesson_dashboard.rb, I get errors.
When I try body:…

Brad West
- 943
- 7
- 19
2
votes
1 answer
Issue with gem administrate 'uninitialized constant Admin::Administrate'
Trying to install Administrator Gem in a ruby app
Follow all the steps and when trying to open the app having this issue in my terminal :
"NameError (uninitialized constant Admin::Administrate):"
CONTROLLERS > ADMIN
module Admin
class…

ALT90
- 21
- 1
2
votes
1 answer
Administrate gem does not allow to view user
A Rails 6.0 uses gem administrate. Users flagged as admin access the pages properly.
The user index is displayed and, for example, the edit page is accessible:
/admin/users/2579/edit
but calling the same object's show page returns an…

Jerome
- 5,583
- 3
- 33
- 76
2
votes
2 answers
What is the proper way to integrate enum with administrate?
I have a rails app where the users have a gender, which is an enum, where 0 means female and 1 means male.
I have this code in the user_dashboard.rb:
require "administrate/base_dashboard"
class UserDashboard < Administrate::BaseDashboard
…

15 Volts
- 1,946
- 15
- 37
1
vote
2 answers
Ruby on Rails form input changing integer to decimal
I've inherited a Ruby on Rails app that uses the administrate gem for an admin dashboard.
This project includes a product model, and each product has a wholesale case price. This field is called wholesale_case_price_cents and is an integer. All…

Nic
- 191
- 1
- 7
1
vote
1 answer
Passing params to another controller in Rails administrate
This would seem to be a fairly straightforward question but I couldn't seem to find anything about it in the docs. I have a model events which has_many nested performances (which has an event_id). Now I could use something…

holden
- 13,471
- 22
- 98
- 160