Building a Rails 8 site is super simple!

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

What do you call a fish wearing a bow tie?

Sofishticated. Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

How do you organise a space party?

You planet. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.

Why did the teddy bear skip dessert?

She was stuffed. Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.

Get started with the app today.

Ac euismod vel sit maecenas id pellentesque eu sed consectetur. Malesuada adipiscing sagittis vel nulla.

Suggested changes

Change to dropdowns instead of input fields

Change from

<%= form.number_field :user_id, class: "..." %>

to something like

<%= form.select(:user_id, User.all.map {|u| [ "%s" % [u.username], u.id]}, {}, { :prompt => t('users.select_user'), :class => "..." } ) %>

Prevent users from self-registering

This application template uses devise for user authentication and by default this allows users to self register. If this is not the intended behaviour there are two things that need to be changed. First, change the value for allow_social_account_creation in /config/application.rb to false. This will prevent users to be able to log on using an identity provider which will result in a local account being created if one does not already exist. However, it is still possible for users to access /users/sign_up and via that page create a local account. An apparent solution is to remove :registerable from the User model but that will not work since it will also remove other generated paths which will break the application. Instead, change the line in /config/routes.rb starting with devise_for to:

devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" }, :skip => [:registrations] as :user do get 'users/edit' => 'devise/registrations#edit', :as => 'edit_user_registration' put 'users' => 'devise/registrations#update', :as => 'user_registration' delete 'users' => 'devise/registrations#destroy' end

Simplify tests with belongs_to

Newer versions of Rails check that belongs_to associations actually point to an existing object. This can be problematic during automated tests. To disable this extra validation during testing, add the following to config/environments/test.rb:

# Disable the need to have a record on the other end of an association config.active_record.belongs_to_required_by_default = false