
Security News
libxml2 Maintainer Ends Embargoed Vulnerability Reports, Citing Unsustainable Burden
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
rails-admin-scaffold
Advanced tools
Rails 4 generator which allows to scaffold admin controllers, views with proper (non-namespaced) models, helpers, tests and routes
gem 'rails-admin-scaffold', 'x.x.x'
to your Gemfilebundle install
bin/rails g admin:scaffold_controller Post title:string content:text published:boolean
bin/rails g model Post title:string content:text published:boolean
and apply migrations bin/rake db:migrate
Put the '_form.html.erb.erb', 'edit.html.erb.erb', 'index.html.erb.erb', 'new.html.erb.erb', 'show.html.erb.erb' into '/lib/templates/admin/scaffold_controller/views/erb/'
Then the generator will use those templates to generate scaffold.
Type your command with option --prefix_name=xxxx.
If you want change the prefix name 'admin' to 'manager' for example you can do something like this:
bin/rails g admin:scaffold_controller Post title:string content:text published:boolean --prefix_name=manager
This will generate class Manager::PostsController < ApplicationController
If you want all your Admin controllers to inherit from another
controller like AdminController
you can specify the
--parent_controller option:
bin/rails g admin:scaffold_controller Post title:string content:text published:boolean --parent_controller=admin
This will generate class Admin::PostsController < AdminController
If you want to generate bootstrap friendly views, use the --bootstrap
option (-b
for short)
bin/rails g admin:scaffold_controller Post title:string content:text published:boolean --bootstrap
FAQs
Unknown package
We found that rails-admin-scaffold demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.