Skip to content

Conversation

@snowistaken
Copy link

…issue with the function to mark complete.

Task List

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Describe in your own words what the Model is doing in Rails The model is the portion of the code that runs all non-display/route related calculations. This helps keep the views clean and free of algorithmic logic.
Describe in your own words what the Controller is doing in Rails The controller is what handles all operations that occur when a request is made to the server.
Describe in your own words what the View is doing in Rails The view is the template for which the data from the request can be displayed in.
Describe an edge-case controller test you wrote
What is the purpose of using strong params? (i.e. the params method in the controller) Strong params allow you to ensure that any object being passed through your controller has the necessary primary structure and only parameters that you allow within that structure. This also allows you to call params in a convenient way within controller methods.
How are Rails migrations related to Rails models? Migrations are the "commits" of your model. This allows you establish new data in your schema.
Describe one area of Rails that are still unclear on I couldn't figure out the error with marking a task as complete. I referenced other classmates code and I can't figure out what would cause the "param is missing or the value is empty: task" error that is presented when you attempt to mark a task complete. This must be something with how I'm calling the route or an issue with my strong params, but I couldn't quite figure out where the issue is.

@dHelmgren
Copy link

Task List

Major Learning Goals/Code Review

Code Review yes/no, and optionally any details/lines of code to reference
At least 6 commits with meaningful commit messages
Routes follow RESTful conventions ✔️
Uses named routes (like _path) ✔️
Creates Models and migrations ✔️
Creates styled views
Handles errors like nonexistant tasks
Uses form_with to render forms in Rails ✔️

Functional Requirements/Manual Testing

Functional Requirement yes/no
Successfully handles index & show ✔️
index & show tests pass
Successfully handles: New, Create crashes, see comment
New, Create tests pass
Successfully handles: Edit, Update
Successfully handles: Destroy, Task Complete

Overall Feedback

Overall Feedback Criteria yes/no
Green (Meets/Exceeds Standards) 5+ in Code Review && 5+ in Functional Requirements
Yellow (Approaches Standards) 3+ in Code Review && 4+ in Functional Requirements, or the instructor judges that this project needs special attention

| Red (Not at Standard) | 0-2 in Code Review or 0-3 in Functional Reqs, or assignment is breaking/doesn’t run with less than 5 minutes of debugging, or the instructor judges that this project needs special attention | ✔️

end

def create
@task = Task.new(task_params)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You never initialize task_params so this always fails.

This is an example of how you might create the strong params:

def task_params
    return params.require(:task).permit(:id, :name, :description, :completed_at)
  end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you would do this at the bottom of the file, not inside create

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.

2 participants