Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMilos Rujevic
Full Stack JavaScript Techdegree Student 39,661 PointsCreate the params hash if it doesn't exist.
???
class AlbumsController < ApplicationController
def index
params.new(:status) if params[:status].nil?
end
end
3 Answers
james white
78,399 PointsChallenge Link:
The second part of the same challenge:
Challenge Task 2 of 2
Assign the @activities variable to a call of Activity.for_user(current_user) and send in the params.
class AlbumsController < ApplicationController
def index
# Write your code here.
params[:page] ||= 1
@activities = Activity.for_user(current_user, params)
end
end
I found the needed second line of code on this Github page:
https://github.com/Rockstage/treebook/blob/master/app/controllers/activities_controller.rb
Milos Rujevic
Full Stack JavaScript Techdegree Student 39,661 PointsI don't know what I have to do in this exercise ?
Maciej Czuchnowski
36,441 PointsAround 3:36 you will get a hint. Something like params[:page] ||= 1
Maciej Czuchnowski
36,441 PointsMaciej Czuchnowski
36,441 PointsWhat is your question?