Getting started with Ruby on RailsRoutingActiveRecordViewsActiveRecord MigrationsRails Best PracticesNaming ConventionsActionCableActiveModelUser Authentication in RailsActiveRecord AssociationsActiveRecord ValidationsActiveRecord Query InterfaceActionMailerRails generate commandsConfigurationI18n - InternationalizationUsing GoogleMaps with RailsFile UploadsCachingActionControllerConfigurationSafe ConstantizeRails 5Authorization with CanCanMongoidGemsChange default timezoneAsset PipelineUpgrading RailsActiveRecord LockingDebuggingConfigure Angular with RailsRails loggerPrawn PDFRails APIDeploying a Rails app on HerokuActiveSupportForm HelpersActiveRecord TransactionsRSpec and Ruby on RailsDecorator patternElasticsearchReact with Rails using react-rails gemRails Cookbook - Advanced rails recipes/learnings and coding techniquesMultipurpose ActiveRecord columnsClass OrganizationShallow RoutingModel states: AASMRails 5 API AutheticationTesting Rails ApplicationsActive JobsRails frameworks over the yearsAdd Admin PanelNested form in Ruby on RailsFactory GirlImport whole CSV files from specific folderTools for Ruby on Rails code optimization and cleanupActiveJobActive Model SerializersRails Engine - Modular RailsSingle Table InheritanceActiveRecord TransactionsTurbolinksFriendly IDSecurely storing authentication keysAuthenticate Api using DeviseIntegrating React.js with Rails Using HyperloopChange a default Rails application enviornmentReserved WordsRails -EnginesAdding an Amazon RDS to your rails applicationPayment feature in railsRails on docker

Add Admin Panel

Other topics

Remarks:

Use it if you want to have Admin to your website otherwise there is no need for this. It is more easy and powerful than active_admin gem. You can add this at any stage after creating users and don't forget to make any user admin before the 4th step. Use cancan for granting roles.

So here are few screen shots from the admin panel using rails_admin gem.

As you can see the layout of this gem is very catching and user friendly.

enter image description here

enter image description here

enter image description here

Syntax:

  1. Open gem file and writer gem 'rails_admin', '~> 1.0'
  2. bundle install
  3. rails g rails_admin:install
  4. it will ask you about the admin route if you want to go with the default press Enter.
  5. Now go app/config/initializers/rails_admin.rb and paste this code: config.authorize_with do redirect_to main_app.root_path unless current_user.try(:admin?) end This code will allow only admin user to access the yoursite.com/admin other users will be redirected to the rootpath.
  6. For more details checkout the documentation of this gem. https://github.com/sferik/rails_admin/wiki

Contributors

Topic Id: 8128

Example Ids: 26203

This site is not affiliated with any of the contributors.