Search functionality for the screencasts
It would be great if can search through the screencasts. You will definitely need one once the number of screencasts increase.
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.
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.