Search And Sort In Ruby On Rails 6 With The Rails Ransack Gem
Vložit
- čas přidán 30. 05. 2024
- This Rails ransack tutorial covers how to search and sort in Ruby on Rails 6. It does this with the Ransack Gem, which is a gem for very rapid prototyping of search forms and sortable tables.
This is part 1 in the Ransack rails tutorial series, which will probably span a few parts. The plan is to cover searching and sorting of simple fields, then searching and sorting of associations, and finally covering some advanced custom search and sort queries.
Links From Video:
Ransack Gem
github.com/activerecord-hacke...
Faker Gem for seeding Data
github.com/faker-ruby/faker
Faker gem page with the lorem sentences and paragraphs
github.com/faker-ruby/faker/b...
GitHub Repo For This Video
github.com/Deanout/ransack1
Photo by Markus Winkler on Unsplash
Timestamps
0:00 Intro and Video Overview
1:01 Code Begins By Adding Ransack Gem To Rails Application
1:40 Creating The Articles Scaffold
2:56 Using The Faker Gem To Seed The Development Database
5:26 Ransack Controller Setup
6:26 Ransack View Setup
10:26 Combine Two Ransack Fields Into One Search Bar
11:16 Sorting With The Ransack Gem
15:10 Sneak Peak At Advanced Ransack Searching And Sorting With Postgresql
16:49 Outro and Video Summary
Follow me on social media:
linktr.ee/deanin
Join this channel to get access to perks:
/ @deanin
If you liked this video, please consider subscribing: t.co/RZ4EwP0F2a
#Deanin #Rails6 #20in20
Thank you very good tutorial i get everything working what i needed with this gem :D Great job
excellent tutorial. Thanks.
Everytime i finding rails, i found here, great hob
Glad to hear it! 🙂
This was soo helpful .. it takes away the huge block of code I write in the controller ... Thank you so much.
I was doing the same thing before someone told me about this gem!
Haha glad it helped!
There's a blog article about this very video that is up early over on my blog if you're interested in a sneak peak or just learn from text better! deanin.com/blog/ransack/
Part 2 is live now: czcams.com/video/rtg-5EXwpbg/video.html
Helping me a lot. Nice video. Thanks
Thank you for this! it's just what i needed.
Happy to help! I've been playing around with it for a bit, so if you have any questions feel free to ask and I might be able to help out with more advanced search functionality
Genial! Muchas gracias! Por fin un tutorial muy bien explicado! Greetings!!!
thank you for lesson! Very helpfulll!
Awesome video, dude
Great video. Thank you.
I am curious how you would create a search_field that allowed you to search for words that were both in the title and body?
For example in the search bar if I type non odio, it would return the article that had 'non' in the title and 'odio' in the body.
I would like to translate this to searching for first and last name in one search bar.
Hi Dean! I have a question. Can elasticsearch be installed on wsl ?
Great video once again this is exactly why I subscribe to your channel 👍 do you take rails video requests?
I appreciate the kind words! Made my day after a long day at work lol.
Absolutely I'll take requests! I can't guarantee that I can pull it off but I'll definitely try to make the video.
Expected more. A lot of questions remained uncovered.
@@Deanin you really are great man I have learned loads from your videos. Just an idea I tried and failed myself was to build a kind of work time keeping app using simple calender gem. I find it hard to use the one in work so I was trying to create a rails app that let's me sign and out each day then simply add up the hours I work each day and week and help me keep track of overtime and holidays. I found the time addition difficult in rails but you are a pro. Just an idea that would make interesting video. Anyway keep the rails videos going
i have bug
undefined method `search' for #
trouble in this line (Articles/index)