The typical way to exclude pages when using get_pages is like this: get_pages(array( "exclude" => "1,2,3" )); Passing in comma-separated list of page id’s that you wish to exclude is easy for a machine to handle, but makes no sense for people. Also, page ID’s can get changed when migrating the site from your [...]
Categories: Uncategorized
- Published:
- November 22, 2009 – 12:45 pm
- Author:
- By Keith Norman
Named scopes and associations using finder_sql don’t mix. And there really is no solution to that problem. Rails has no way to inject conditions into raw SQL that may or may not follow Active Record conventions. But, the need may come up that you want to return a set of records from an association driven [...]
Categories: ruby on rails,Uncategorized,web development
Tagged: finder_sql, named_scope, rails
- Published:
- November 21, 2009 – 10:04 pm
- Author:
- By Keith Norman
I intend to make this post a running tally of useful regex’s that I use, but for now I just have one. This will extract a URL form a string. I’m using it to tinyurl URL’s in a twitter post that are posted from the Firebelly CMS. /(http|https):\/\/([a-z0-9]+)[-.]?([a-z0-9]+).[a-z]{2,5}(([0-9]{1,5})?[\/\?][[\S]]?)?/ix
Categories: Uncategorized
- Published:
- March 12, 2009 – 11:09 am
- Author:
- By Keith Norman
For the most part I followed this guide, but I kept getting this error: ffmpeg: error while loading shared libraries: libavfilter.so.0: cannot open shared object file: No such file or directory Turns out that the answer was also in a comment on that blog post ldconfig Then test the install again with ffmpeg -v and [...]
Categories: Uncategorized
- Published:
- February 18, 2009 – 6:58 pm
- Author:
- By Keith Norman