I have one HTML view called import.html. I use an instance variable instead of a model to import data and then I display the data on the same template (import.html). Very simple. Implementing paginate following your tutorial leaves me stuck: I do not have a route configured for when I click to go to any other page so "GET '/?page=2" defaults to my show method which just goes to the home page. How do I configure the route to go to the right page?
If I have an app where user can only see the list of bookmarks created by him(after login) in that case how we will implement pagination? In index action i'll list all the bookmarks belongs to current user & on the top of it I have to apply pagination. I tried @bookmarks = current_user.bookmarks @books = @bookmarks.paginate(page: params[:page], per_page: 10) but its not working :(
Sorry I've been a bit silent lately! I'm working on a full course that will take you step by step from design to code in building a rails web app :) I'll be releasing the course in a few weeks!
***** plz make a tutorial on Admin Interface, ActionMailor and CMS .....really waiting for any of these three.It wil be very helpful. Actually there are no quality tutorials on the web regarding these three crucial topics....and as per my intellect these are very important to go to the next level.
it's possible to use this on a "home-made" array? i mean, an array of recent activity wich contains more than 1 class on it e.g: def user_activity @array_activity= [].paginate(page: params[:page], per_page: 4) @testannounces= Announce.all.paginate(page: params[:page], per_page: 2) @testchallenges= Challenge.all @testannounces.each do |x| @array_temp= [] @array_temp.push x.created_at @array_temp.push"announce" @array_temp.push x @array_activity.push @array_temp end @testchallenges.each do |y| @array_temp= [] @array_temp.push y.created_at @array_temp.push"challenge" @array_temp.push y @array_activity.push @array_temp end @array_activity.sort_by!{ |x| x[2].created_at } end in this case, how can i paginate that list?, any idea? :) thx!
Hello mackenzie, do you think you can make a tutorial on how to add the country_select gem (github.com/stefanpenner/country_select) as a category?, so people can fx upload a post and order it by countries, so other people from that same country can sort through the post from their country, just like in the jobs board demo application, but instead of ordering it by categories, you will be able to order it by countries :) and do you have any experience with this gem, if so can you recommend some tutorials? :)
hey Mack, I know your doing the Rails Thing / wanted to know if you could do something similar to the "Rails How To" with React.js / theres really no videos on it / just conferences / check it out: facebook.github.io/react/
At some point I plan on getting into a front-end framework (At the moment I'm thinking Ember because it's made by the same people who have worked on Rails, so it'd be a good transition I think)
You're quickly becoming one of my fave Rails tutors.
Enda Rochford Whaaaat! I'm honored :)
Mackenzie Child Keep up the good work!
5 years from pub. date and remain helping. Thank you.
Fantastic. Quick, neat, and to the point. Thank you.
Austin Archibald Thanks Austin :)
all the tutorial is very helpful to me , I am happy with your teaching style, thank you very much
fansyah fathur Happy to help Fansyah :)
In the future a video on testing would be great. Keep up the good work!
Nice, man! Simple and fast! =D Thanks! I will apply in my project now.
Excelente.... Regards From PANAMÁ, REP. PANAMÁ.
:)
Thank you for tutorial! It's simple and great!
Glad you like it!
thanks.. its a really easy and helpful
Great screencast
Thanks :)
This is so useful, thanx
:)
thank you for great tutorial. :)
I like it..you should make more videos Mackenzie!!
Kaye BT Thanks! Also, I have ;) (And will continue too! Checkout my site Unicasts.com... That's where all my videos live now)
great video tho love your stuff!
Thanks :)
thanks mackenzie!!!
good explications
hi,can you help me to use paginate gem in movie review app? Where do i need to place pagionation method? here is on 2:11 minute.Thank you! Great work!
lukahari You'd place it in the Movies Controller Index Method... Just like we do at 2:11 :)
I figure it out :) it is now working :) nice work,keep on going!
great! thank you
I have one HTML view called import.html. I use an instance variable instead of a model to import data and then I display the data on the same template (import.html). Very simple.
Implementing paginate following your tutorial leaves me stuck: I do not have a route configured for when I click to go to any other page so "GET '/?page=2" defaults to my show method which just goes to the home page. How do I configure the route to go to the right page?
After setting up this gem I can get back to viewing all posts right?
+Malek Zalfana Yeah man. This gem just changes the url to show different posts. You can always go back to /posts (or whatever) to see all of them.
If I have an app where user can only see the list of bookmarks created by him(after login) in that case how we will implement pagination?
In index action i'll list all the bookmarks belongs to current user & on the top of it I have to apply pagination.
I tried
@bookmarks = current_user.bookmarks
@books = @bookmarks.paginate(page: params[:page], per_page: 10)
but its not working :(
Thank you Mackenzie Child
Thank you +Mackenzie Child you saved a day. Infinite scroll with will_paginate will also help.
+sainath devulapalli Whoo 🙌
Could you do a tutorial on how to make a search bar?
Askari Abdur-rahman Yep, its on my list!
Thanks!
super
What next? Waiting for your next video.
Sorry I've been a bit silent lately! I'm working on a full course that will take you step by step from design to code in building a rails web app :) I'll be releasing the course in a few weeks!
Mackenzie Child i ll subscribe to the course if affordable
:)
***** plz make a tutorial on Admin Interface, ActionMailor and CMS .....really waiting for any of these three.It wil be very helpful.
Actually there are no quality tutorials on the web regarding these three crucial topics....and as per my intellect these are very important to go to the next level.
Definitely want to cover them in the future :)
Mackenzie Child i want i suggestion plz reply, what to use for other uploads like office files,pdf files etc.
You can use paperclip for that. Or maybe something like Refile or CarrierWave.
it's possible to use this on a "home-made" array? i mean, an array of recent activity wich contains more than 1 class on it
e.g:
def user_activity
@array_activity= [].paginate(page: params[:page], per_page: 4)
@testannounces= Announce.all.paginate(page: params[:page], per_page: 2)
@testchallenges= Challenge.all
@testannounces.each do |x|
@array_temp= []
@array_temp.push x.created_at
@array_temp.push"announce"
@array_temp.push x
@array_activity.push @array_temp
end
@testchallenges.each do |y|
@array_temp= []
@array_temp.push y.created_at
@array_temp.push"challenge"
@array_temp.push y
@array_activity.push @array_temp
end
@array_activity.sort_by!{ |x| x[2].created_at }
end
in this case, how can i paginate that list?, any idea? :)
thx!
Hello mackenzie, do you think you can make a tutorial on how to add the country_select gem (github.com/stefanpenner/country_select) as a category?, so people can fx upload a post and order it by countries, so other people from that same country can sort through the post from their country, just like in the jobs board demo application, but instead of ordering it by categories, you will be able to order it by countries :)
and do you have any experience with this gem, if so can you recommend some tutorials? :)
I've never used that Gem before, but I'll look into it and possibly make a video on it in the future :)
ActionMailer plz
I prefer kaminari for pagination
What's the benefits of Kaminari over will_paginate?
hey Mack, I know your doing the Rails Thing / wanted to know if you could do something similar to the "Rails How To" with React.js / theres really no videos on it / just conferences / check it out: facebook.github.io/react/
At some point I plan on getting into a front-end framework (At the moment I'm thinking Ember because it's made by the same people who have worked on Rails, so it'd be a good transition I think)
does not render