Search And Sort In Ruby On Rails 6 With The Rails Ransack Gem

Sdílet
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

Komentáře • 21

  • @antskaval85
    @antskaval85 Před 7 měsíci

    Thank you very good tutorial i get everything working what i needed with this gem :D Great job

  • @rahulk6130
    @rahulk6130 Před 11 měsíci

    excellent tutorial. Thanks.

  • @dev9033
    @dev9033 Před rokem +1

    Everytime i finding rails, i found here, great hob

    • @Deanin
      @Deanin  Před rokem

      Glad to hear it! 🙂

  • @draytechitsolutions4957
    @draytechitsolutions4957 Před 2 lety +1

    This was soo helpful .. it takes away the huge block of code I write in the controller ... Thank you so much.

    • @Deanin
      @Deanin  Před 2 lety +1

      I was doing the same thing before someone told me about this gem!
      Haha glad it helped!

  • @Deanin
    @Deanin  Před 2 lety +4

    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

  • @MrKeliv
    @MrKeliv Před 2 lety +1

    Helping me a lot. Nice video. Thanks

  • @pablo6263a
    @pablo6263a Před 2 lety +2

    Thank you for this! it's just what i needed.

    • @Deanin
      @Deanin  Před 2 lety +1

      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

  • @cristianramirez1160
    @cristianramirez1160 Před 2 lety

    Genial! Muchas gracias! Por fin un tutorial muy bien explicado! Greetings!!!

  • @stanislavtimanov
    @stanislavtimanov Před rokem +1

    thank you for lesson! Very helpfulll!

  • @julianligresti8087
    @julianligresti8087 Před 2 lety +1

    Awesome video, dude

  • @xp3113
    @xp3113 Před rokem

    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.

  • @vedvyas710
    @vedvyas710 Před 2 lety

    Hi Dean! I have a question. Can elasticsearch be installed on wsl ?

  • @rapfan353
    @rapfan353 Před 2 lety +2

    Great video once again this is exactly why I subscribe to your channel 👍 do you take rails video requests?

    • @Deanin
      @Deanin  Před 2 lety +1

      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.

    • @ledockol
      @ledockol Před 2 lety

      Expected more. A lot of questions remained uncovered.

    • @rapfan353
      @rapfan353 Před 2 lety +1

      @@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

  • @abxcoder6255
    @abxcoder6255 Před rokem

    i have bug
    undefined method `search' for #