Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure controllers #9

Merged
merged 6 commits into from
Jul 10, 2023
Merged

Configure controllers #9

merged 6 commits into from
Jul 10, 2023

Conversation

•Created a method update_allowed_parameters in ApplicationController to configure permitted parameters for Devise.
•Added a before_action callback to invoke the update_allowed_parameters method before any Devise controller action.
•In the update_allowed_parameters method, used devise_parameter_sanitizer.permit to specify the permitted parameters for sign-up and account update actions.
•For sign-up, permitted the name, email, and password attributes.
•For account update, permitted the name, email, password, and current_password attributes.
•Added a before_action callback to set the category instance variable for the show, edit, update, and destroy actions.
•Implemented the index action to fetch categories belonging to the current user, ordered by creation time.
•Implemented the show action to fetch the category and its associated entities, ordered by creation time.
•Implemented the new action to instantiate a new category object.
•Implemented the create action to create a new category with the provided parameters and associate it with the current user.
•Implemented the update action to update the category with the provided parameters.
•Implemented the destroy action to find and delete the specified category.
•Defined private helper methods to set the category and permit trusted parameters.
•Created a new controller called SplashesController.
•Implemented the index action within the SplashesController.
•The index action is currently empty and does not contain any logic or view rendering.
•	Added the devise_for :users route to handle user authentication routes provided by Devise.
•	Added a get route for the /splash URL, directing it to the splashes#index action.
•	Defined routes within the devise_scope block to handle root URLs for authenticated and unauthenticated users.
•	For authenticated users, set the root URL to categories#index action and name it authenticated_root.
•	For unauthenticated users, set the root URL to splashes#index action and name it unauthenticated_root.
•	Created nested routes for user resources, allowing routes for categories and entities that are associated with a user.
•	Restricted the routes for users to only the index, show, and new actions.
•	Restricted the routes for categories to only the new, create, show, index, and destroy actions.
•	Restricted the routes for entities to only the new, create, index, show, and destroy actions.
@Lucas-Erkana Lucas-Erkana merged commit 59ee447 into develop Jul 10, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant