Questions tagged [trestle-admin]
9 questions
6
votes
1 answer
How do I specify an ability for a route created by a Rails engine?
I am using Trestle Admin, this is my route:
trestle_path /admin Trestle::Engine
When a user that is not an admin visits the /admin route, I would like CanCanCan to handle it like it handles all of the other unauthorized requests in…

marcamillion
- 32,933
- 55
- 189
- 380
2
votes
0 answers
How do I get the previously selected value from the dropdown in trestle admin
I have two select fields and I want to show the second dropdown based on previously selected dropdown value
e.g:
form do |record|
...
select :app_ids, App.all.map{|app| [app.name, app.id]}, {label: 'App'}
select :role_ids, AppRole.where(app_id:…

M.R
- 610
- 2
- 10
- 34
2
votes
1 answer
Trestle Request unsuccessful. Incapsula incident WebApi error
I'm working with Trestle which is real estate MLS service to get property data etc. I have followed their WebApi docs but I'm getting this error whenever I hit their api it looks like their server thinks that request is from some BOT. Even they…

Zayn
- 741
- 1
- 5
- 22
1
vote
1 answer
Rails - using Trestle/admin to display associated records
I am using trestle for admin in a Rails project.
I have Teachers with many Students. There is a proper has_many and belongs_to association. I have everything working nicely in tabs, In one tab I have teacher information and in the other tab I want…

gofly
- 13
- 4
1
vote
1 answer
select2 doesn't work in rails 6 with trestle
When i go to http://localhost:3000/admin/sport_categories
the console logs don't fire from forms.js
javascript/packs/forms.js
import $ from 'jquery'
import 'select2'
import 'select2/dist/css/select2.css'
console.log('line…

Pavan Katepalli
- 2,372
- 4
- 29
- 52
1
vote
0 answers
How i implement test rspec for controller admin trestle
I create the controller copy syllabus in trestle in:
app/admin/copy_syllabus.rb
This is my content
Trestle.admin(:copy_syllabus) do
menu do
item :copy_syllabus, icon: "fa fa-tachometer"
end
controller do
def index
end
…

HalleyRios
- 602
- 1
- 4
- 18
0
votes
1 answer
Trestle Admin Custom Delete
i am new to rails & using Trestle Admin as an easy backend solution for my app.
When i try to delete an item in the trestle admin backend, i get following error:
PG::ForeignKeyViolation: ERROR: update or delete on table "AAA" violates foreign > key…

Jonas Schmitt
- 53
- 5
0
votes
1 answer
TestleAdmin Rails: How to fetch current logged in Admin or User
Here, I tried to fetch the current logged in User/Admin in the app but failed to see logged in user.
Model: Administrator
In Event model, trying to store who created the event by fetching loggedin-user in model before_create method.
Tried current,…

Rubyist
- 6,486
- 10
- 51
- 86
0
votes
0 answers
Trestle TinyMCE Gem Uncaught TypeError: Cannot read properties of undefined (reading 'dom')
After clicking on the source-code button of the editor, the complete text vanishes.
Gem details:
gem 'trestle', '0.9.2'
gem 'trestle-auth', '0.3.0'
gem 'trestle-search', '0.4.1'
gem 'trestle-tinymce', '0.3.1'
gem 'tinymce-rails', '5.10.1'
Step…

Rubyist
- 6,486
- 10
- 51
- 86