Closed CCH4GITHUB closed 2 years ago
New project in Rails 7
Will retry with new project in Rails 7 and with instructions from Readme rather than wiki
bundle install
rails g active_scaffold:install
rails db:create
rails g active_scaffold:resource Model [attrs]
rails db:migrate
Run the app and visit localhost:3000/
Above works with Rails 7.0.2.3 / ruby 2.75
But must add gem gem "sassc-rails" gem 'active_scaffold', github: 'activescaffold/active_scaffold', branch: 'master'
Tip: To connect to postgresql, must add username/password to database.yml
Updated to master branch, now I am getting error undefined method `set_defaults' for ActiveScaffold:Module
@deep021985 can you post the full backtrace, and if the set_defaults
call happens to be in your code, then could you show the contents of that file?
Backtrace: Puma starting in single mode...
NoMethodError (undefined method `set_defaults' for ActiveScaffold:Module):
app/controllers/application_controller.rb:12:in <class:ApplicationController>' app/controllers/application_controller.rb:1:in
<top (required)>'
app/controllers/ticket_logs_controller.rb:1:in `<top (required)>'
Code
class ApplicationController < ActionController::Base require 'spreadsheet' protect_from_forgery with: :exception
before_action :current_emp helper :all # include all helpers, all the time
before_action :login_required
ActiveScaffold.set_defaults do |config| config.actions = [:create, :list, :search, :show, :update, :delete, :nested, :subform] config.list.page_links_inner_window = 5 #no of pages to show config.delete.link.confirm = 'Are you sure to delete this record?' end --Rest of the code----
Use .defaults instead of .set_defaults, set_defaults was deprecated in 3.6.0, and it's removed in master branch
C:\PRJ4RAILS\rnd4pg> gem install active_scaffold Fetching activesupport-6.1.5.gem Fetching actionview-6.1.5.gem Fetching actionpack-6.1.5.gem Fetching activemodel-6.1.5.gem Fetching activerecord-6.1.5.gem Fetching activejob-6.1.5.gem Fetching actionmailer-6.1.5.gem Fetching actioncable-6.1.5.gem Fetching active_scaffold-3.6.8.gem Fetching activestorage-6.1.5.gem Fetching actionmailbox-6.1.5.gem Fetching actiontext-6.1.5.gem Fetching railties-6.1.5.gem Fetching rails-6.1.5.gem Successfully installed activesupport-6.1.5 Successfully installed actionview-6.1.5 Successfully installed actionpack-6.1.5 Successfully installed activemodel-6.1.5 Successfully installed activerecord-6.1.5 Successfully installed activejob-6.1.5 Successfully installed actionmailer-6.1.5 Successfully installed actioncable-6.1.5 Successfully installed activestorage-6.1.5 Successfully installed actionmailbox-6.1.5 Successfully installed actiontext-6.1.5 Successfully installed railties-6.1.5 Successfully installed rails-6.1.5 Successfully installed active_scaffold-3.6.8 Parsing documentation for activesupport-6.1.5 Installing ri documentation for activesupport-6.1.5 Parsing documentation for actionview-6.1.5 Installing ri documentation for actionview-6.1.5 Parsing documentation for actionpack-6.1.5 Installing ri documentation for actionpack-6.1.5 Parsing documentation for activemodel-6.1.5 Installing ri documentation for activemodel-6.1.5 Parsing documentation for activerecord-6.1.5 Installing ri documentation for activerecord-6.1.5 Parsing documentation for activejob-6.1.5 Installing ri documentation for activejob-6.1.5 Parsing documentation for actionmailer-6.1.5 Installing ri documentation for actionmailer-6.1.5 Parsing documentation for actioncable-6.1.5 Installing ri documentation for actioncable-6.1.5 Parsing documentation for activestorage-6.1.5 Installing ri documentation for activestorage-6.1.5 Parsing documentation for actionmailbox-6.1.5 Installing ri documentation for actionmailbox-6.1.5 Parsing documentation for actiontext-6.1.5 Installing ri documentation for actiontext-6.1.5 Parsing documentation for railties-6.1.5 Installing ri documentation for railties-6.1.5 Parsing documentation for rails-6.1.5 Installing ri documentation for rails-6.1.5 Parsing documentation for active_scaffold-3.6.8 Installing ri documentation for active_scaffold-3.6.8 ERROR: While executing gem ... (Errno::EINVAL) Invalid argument @ dir_s_mkdir - ./< PS C:\PRJ4RAILS\rnd4pg>