Skip to content

Create Form for Puppy Model#5

Open
mclancy96 wants to merge 2 commits intopowercodeacademy:masterfrom
mclancy96:new-branch
Open

Create Form for Puppy Model#5
mclancy96 wants to merge 2 commits intopowercodeacademy:masterfrom
mclancy96:new-branch

Conversation

@mclancy96
Copy link
Copy Markdown

This pull request implements the core functionality for a basic Puppy adoption Rails app. It introduces the Puppy model with the necessary database migration, sets up the PuppiesController with actions to display, create, and show puppies, and provides the corresponding views and routes for user interaction.

Model and Database Setup

  • Added the Puppy model as an ApplicationRecord and created a migration to generate the puppies table with name, breed, and age attributes. [1] [2]

Controller Actions

  • Implemented the index, new, and create actions in PuppiesController, including strong parameter handling for puppy creation.

Routing

  • Defined routes for the homepage, new puppy form, and puppy creation, with the root path set to the puppies index.

Views

  • Built views for:
    • Listing the homepage and linking to the new puppy form (index.html.erb).
    • Displaying the new puppy form using Rails form helpers (new.html.erb).
    • Showing the created puppy's details after submission (create.html.erb).

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