Skip to main content

Search functionality for the screencasts

Site Feedback • Asked by harsha vardhan mudumba venkata

It would be great if can search through the screencasts. You will definitely need one once the number of screencasts increase.


That's a good idea. I'll hook that in soon.


Hate to bump an old topic, but doing a screencast on search would really be useful. i.e. writing search from scratch that can search through multiple models and associations. CodeSchool's FeatureFocus did something like this with DHH writing something wicked, figured you might want to write some search instead of using a gem like ransack. Would be a good learning opportunity for the GoRails community.


Like this? :) https://gorails.com/episodes/forum-search-with-ransack

I can't remember if I talk about going through multiple models, but it's about as simple as making your search field names include the two model names.


Yes, this is good but I was thinking of doing one where the search functionality is written from scratch. It would be cool to write something like this. In fact I'm in the middle of writing some complex search without using Ransack or Elastic. If you want some help on a screencast, let me know.


Ah interesting. How come you're going with a custom search?


Same reason I'm trying to write my own version of Devise and CanCanCan, practice :)

Ransack would probably take care of everything I need, but I'm fascinated as of late with writing things from scratch.


I just followed the ransack tutorial. got it up and running great in development but when I pushed to heroku I get this error...

Heroku logs:

2015-01-24T01:54:38.069528+00:00 app[web.1]: PG::UndefinedFunction: ERROR: operator does not exist: timestamp without time zone ~~* unknown
2015-01-24T01:54:38.069537+00:00 app[web.1]: HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
2015-01-24T01:54:38.072276+00:00 app[web.1]: ActionView::Template::Error (PG::UndefinedFunction: ERROR: operator does not exist: timestamp without time zone ~~* unknown
2015-01-24T01:54:38.072298+00:00 app[web.1]: app/controllers/pins_controller.rb:20:in `index'
2015-01-24T01:54:38.072281+00:00 app[web.1]: HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
2015-01-24T01:54:38.072301+00:00 app[web.1]:
2015-01-24T01:54:38.069538+00:00 app[web.1]: : SELECT DISTINCT "pins".* FROM "pins" LEFT OUTER JOIN "users" ON "users"."id" = "pins"."user_id" WHERE (("users"."name" ILIKE '%Bobby Romelo%' OR "pins"."created_at" ILIKE '%%'))
2015-01-24T01:54:38.072278+00:00 app[web.1]: LINE 1: ...me" ILIKE '%Bobby Romelo%' OR "pins"."created_at" ILIKE '%%'...

Any ideas on what's going on?


It looks like you're trying to do a string comparison on the created_at timestamp. I think you want to use created_at_gteq instead of created_at_cont in your search form.


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 24,647+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.