Completely new to Active Admin, can someone clarify how it accesses app models? - activeadmin

I have just installed active admin, and I am unsure of how it accesses data from models I have created.
I've read the active admin documentation, but it's not very clear abut where code to customize/access information should be saved- dashboard.rb? active_admin.rb?
Do I need to add files/code to allow active admin to access other models in the app?
Thanks in advance!

First, you have to register you're model with Activeadmin
rails generate active_admin:resource MODEL_NAME
Then it creates a file under /app/admin with you're model name. There you can customize/access required information.

Related

How to model account logic?

Say, I want to create an account system. there is a user id, user name, user email and other fields.
I have the following "find_by" scenarios, so I will also have some "find_by" tables such as account_by_name, account_by_email.
When create an account, I need to check whether the name or email has already been used or not.
Considering the restrictions of batch and lwt, how to accomplish the logic above?
Try looking at the KillrVideo example project. You can look at the schema to see how the user tables were modeled, and look at the user DAO code to see how users are created using LWT. KillrVideo also has examples using other programming languages; you will find links to all the github repos on their website.

How to use Strapi to store user data

I am creating an eCommerce platform using strapi. Strapi only has option for user-email and password.
I want to store user's address, contact details, previous orders etc. Is there a way to do so?
I am using the quickstart template.
Strapi version 3.0.0-beta.17.7 (node v10.16.3)
IMO the best way would be to create a profile model with a one to one relation to the user. You will need to create your own isOwner policy on the findOne, create, update routes however. This way on that user can view/create/update their own profiles.
Off course there is a way to do so!
Go to your admin panel http://localhost:1337/admin
Click on Content Type Builder on your left sidebar
Select User
Click on Add Another Field
And add every field you need for your eCommerce platform!

Disable exporting data from the user interface

Can we disable exporting data from the user interface actions in Kentico Managing form data?
Regards,
SA
Try setting the ShowObjectMenu property of the UniGrid to false. Detailed documentation available here.
The UniGrid definition should be the one found in this file (can't verify it as I currently don't have access to a Kentico instance): CMSModules\BizForms\Controls\BizFormEditData.ascx
Not all objects, pages, etc have the permissions available/coded to allow this restriction that I'm aware of within the user interface. Take a look at the post I wrote on restricting download/export of anything out of Kentico.
Short story is you set the permissions at the IIS level on /CMS/CMSSiteUtils/Export directory to not allow the user running IIS app pool to access that directory. This directory is where all exports, no matter what, get sent to.

can users follow specific Django model IDs

I'm quite new to GetStream. After successfully testing/using the default feeds, now I would need that users could choose within one Django Model several records to follow, e.g. user1 follows Model IDs=1,10,20 updates; user2 follows model IDs=1,30,40 updates and so on.
A Celery task can update Model records and users that are following specific IDs should get a notification if the records were updated.
Is it possible?
If so how? I sincerely don't have a clue how to do it.
A huge thanks GetStream for all great resources!
D
We have some code in the Django SDK called feed_manager.get_notification_feed() which can get a notification feed name for users based on an activity type. Our README file talks about doing this in a Tweet model here. You might need to adapt some code to your specific use case.
Our Python SDK has a function for building a batch of follow requests to help manage user:1 follows model:1, user:1 follows model:10 and so on; check out the follow_many code here.

Drupal programmatically stop module hook

I am using the autoassignrole module to assign ROLE#1 to anyone registering on my site.
Once signed in, users with ROLE#1 permissions can create users of their own for which I am using the uCreate module.
I have it setup so that when creating users via the uCreate module, the new user can be assigned ROLE#2 or ROLE#3 permissions.
The problem is at this point. The new user also inherits the ROLE#1 from the autoassignrole module.
So, I put together a custom module and implemented hook_user and the plan is to detect when a user is being registered and programmatically stop the autoassignrole user_hook ... how do I do that?
There are 2 potential solutions that I see at a high level:
If uCreate has a custom form to create users, you can alter that form to also include a on-submission database query that removes the role from the user being created
You can check if adding a condition to the autoassignrole module is possible-to attempt to disable autoassignment if the user's creation comes from an administration/uCreate add user URL

Resources