activescaffold / active_scaffold

Save time and headaches, and create a more easily maintainable set of pages, with ActiveScaffold. ActiveScaffold handles all your CRUD (create, read, update, delete) user interface needs, leaving you more time to focus on more challenging (and interesting!) problems.
MIT License
1.09k stars 328 forks source link

Rail 7 - gem install active_scaffold #686

Closed CCH4GITHUB closed 2 years ago

CCH4GITHUB commented 2 years ago

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>

CCH4GITHUB commented 2 years ago

New project in Rails 7

CCH4GITHUB commented 2 years ago

Will retry with new project in Rails 7 and with instructions from Readme rather than wiki

CCH4GITHUB commented 2 years ago

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

deep021985 commented 1 year ago

Updated to master branch, now I am getting error undefined method `set_defaults' for ActiveScaffold:Module

gregschmit commented 1 year ago

@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?

deep021985 commented 1 year ago

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

protect_from_forgery unless: -> { request.format.json? }

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----

scambra commented 1 year ago

Use .defaults instead of .set_defaults, set_defaults was deprecated in 3.6.0, and it's removed in master branch