Rails 6.1, Ruby 3.0.0: Tests Error as They Cannot Load Rexml

Rails 6.1, Ruby 3.0.0: tests error as they cannot load rexml

rexml gem is a bundled gem since Ruby 3.0.0.
So you must add rexml to Gemfile.

On Ruby 2.6 and 2.7, rexml gem is default gem.
So default rexml is used if Gemfile does not include rexml.
On these versions of ruby, you must add rexml to Gemfile only if you want to use specific rexml version.

Rails: How can I regenerate all the views created by scaffold after I make changes to the underlying table?

You could reverse the scaffold generation and regenerate a new scaffold with renamed and new columns.

If you already migrated the database you will need to roll it back.

rake db:rollback

Then you can reverse the scaffold generation.

rails destroy scaffold MyFoo

Then generate new scaffold with updated columns

rails generate scaffold MyFoo column_name_1:data_type column_name_2:data_type column_name_3:data_type

Otherwise you can manually rewrite your views and controllers to include the updated and new columns.



Related Topics



Leave a reply



Submit