Skip to main content

Using ActiveAdmin to Build an Admin UI Discussion

General • Asked by Chris Oliver

Hey Chris, At min 8 sec 49, i am trying to follow along. My screen looks like http://imgur.com/9bnEuG0 and yours has the user dropdown. I am not sure what I must have missed. Do you know what it is? I will be trying to figure it out here, and will update you if I find it, thanks, and later I am not seeming to get the association of the user :
ID1
TITLEpost 1
BODYthis is my post
PUBLISHED ATDecember 28, 2016 23:43
USEREMPTY
CREATED ATDecember 28, 2016 23:43
UPDATED ATDecember 28, 2016 23:43

Did you add the user_id column to your Post model?

This is what I have in admin/post.rb. Is this what you are referring to?

permit_params :title, :body, :published_at, :user_id

Sorta! This will permit it if it's submitted, but your form is automatically generated by your database columns. If your migration didn't include a user_id column, then you won't have that in the form. Check that and make sure you added one, if not you can rollback and edit or add a new migration for it. I think that's probably the culprit.

http://imgur.com/Y59KiQV here is what my migrations look like. I tried rolling back and migrating again. But still nothing. Im betting its probably something super obvious like a typo or something

Hmm, looks right. Also double check you've got a belongs_to :user on the model I guess. I'm not sure what else it might be. That's odd.

ah yes, noob mistake lol, i totally forgot to add the belongs_to, now it works, cool stuff, thanks

Haha no worries man, it's not a noob mistake, definitely one that I'd be like huh that's weird and have to do some digging to make sure it was all configured right myself. Run into those things all the time.

@excid3:disqus I am facing the same problem and I have added the belongs_to, but still it doesn't show the user and if I post something user field shows empty


Hey @excid3:disqus, thanks for the vid. How would you rate Active Admin vs Administrate which you covered in Episode 94? I'm looking for something lightweight for one of my bigger apps.

By the way for those reading this. There's been a vulnerability issue reported for the Rails_admin and Administrate gems for part versions. So be sure to update them if you're using those.

See:
https://blog.sourceclear.co...

I prefer Administrate personally because it's more or less just regular controllers namespaced to the admin area. No special DSLs or anything, so you can customize it just like you would write your normal app.

Also yeah, noticed those security updates recently as well. 👍

Thanks! Will most probably go with that then. Nothing too heavy handed. Had some experience in Active Admin for a project I helped in.. just felt too heavy.

Hey @disqus_RYFYDXZ9Pd:disqus where is the security vulnerability for Administrate? Not seeing a new version since Oct 28, at 0.3.0. Am I missing something?

Hey @Marc Gayle you should be safe by now. It was back for 0.1.5.

You can check it out here: https://blog.sourceclear.co...


You should use "RailsAdmin" or "ActiveAdmin" .. what is the most practical?

Greeting


I didn't get how do you fix the

Path for JQuery UI Datepicker is wrong

In your Gemfile change the line that loads the gem to:

gem 'activeadmin', git: 'https://github.com/activeadmin/activeadmin.git'

Where is the GitHub source code for this episode?

Some of these early episodes don't have the source code uploaded unfortunately. I was terrible at saving the code early on!


@excid3:disqus I am facing the same problem as @jacobgiberson:disqus and I have added the belongs_to, but still it doesn't show the user and if I post something user field shows empty


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 24,647+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.