Skip to content

Conversation

@julmeier
Copy link

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 retrieves and assigns data to and from the database and handles the business logic. ActiveRecord models the database structure and their relationships - it creates a Ruby class for each model (table)
Describe in your own words what the Controller is doing in Rails The controller is the handler of information that comes from and goes to the model, views and browsers. It handles all browser-related requests. The controller is in charge of making sense of user requests and producing the appropriate output.
Describe in your own words what the View is doing in Rails The view provides the information and styling of data (HTML, CSS) that will be shown to the user. They do not have any business logic or "know" any of the data held by the model.
What is the purpose of using strong params? (i.e. the params method in the controller) Strong parameters is a rails plug-in that helps the controller prevent mass assignment of data unless explicitly allowed. I need more practice in using strong params, as I'm still fuzzy on it's application.
How are Rails migrations related to Rails models? Migrations cause changes to the schema of the model, such as adding or deleting columns.
Describe one area of Rails that are still unclear on Where does the data entered into my model actually "live"? Is there a file in our rails application that shows all this data?
Also, I don't have a good understanding of how the rails files, such as routes.rb, will change as the number of models increases.

@CheezItMan
Copy link

Task List

What We're Looking For

Hello Julia,

Dee & I are switching off for the Rails unit on feedback & 1-1s. So I'll be doing your individual feedback for Rails.

Feature Feedback
Baseline
Appropriate Git Usage with no extraneous files checked in Good number of commmits. For commit messages avoid talking about waves, but focus on functionality done.
Answered comprehension questions Check, Strong params isn't a plug-in to rails, it's an integral part of it. It allow us to limit the fields changed directly to a specific list. The data that' added to the model is stored in a set of files tracked by the postgres database. I think next week you'll have a better undertanding of how routes.rb will change.
Successfully handles: Index, Show Check
Successfully handles: New, Create Check
Successfully handles: Edit, Update Check
Successfully handles: Destroy, Task Complete Check
Routes follow RESTful conventions The paths are a little off, it should be named: /tasks instead of /task_list.
Uses named routes (like _path) Check
Overall Nicely done, love the bananna. I suggest you avoid using so many div elements and instead use semantic html tags like article or section. You really have WAAAAYYY too many div element. I also left some comments in your code for guidance.

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

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

a few comments.


def show

@task = Task.find( params[:id].to_i )

Choose a reason for hiding this comment

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

It's a good idea to have some sort of if statement here to handle the occasions where you can't find the given task. This applies to the actions, edit, delete, etc.

end

def create
@task = Task.new(completion_date: nil, name: params[:task][:name], action: params[:task][:action], status: params[:task][:status])

Choose a reason for hiding this comment

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

This would make a good use-case for strong params.

<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
<link href="https://fonts.googleapis.com/css?family=Homemade+Apple|Indie+Flower|Permanent+Marker|Sedgwick+Ave|Waiting+for+the+Sunrise|Walter+Turncoat" rel="stylesheet">
</head>
<header class="header">

Choose a reason for hiding this comment

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

The header should be inside the body.

<body>

<%= yield %>
</div>

Choose a reason for hiding this comment

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

What does the </div> match?

<!-- TaskList#index -->

<!-- <h1 class="index-heading">Task List</h1> -->
<nav class="menu-container">

Choose a reason for hiding this comment

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

I suggest this nav should go in the layout file so it can be consistent between pages.

<li class="show-status"><h4>status:
<%= @task.status ? "completed on #{@task.completion_date}" : "not yet complete" %></h3></li>
</ul>
<%else%>

Choose a reason for hiding this comment

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

This kind of logic, should probably be done in the controller, but you're not at that point in your rails training yet.

Good idea on how to handle this.

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