RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Submit a post

You can use basic HTML markup (e.g. <a>) or Markdown.
Note that your post may be edited to suit the format of the site.

As you are not logged in, you will be
directed via GitHub to signup or sign in

Post Preview

Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.

Sanitize: A whitelist-based Ruby HTML sanitizer

Sanitize is a new whitelist-based HTML sanitizer for Ruby. Using a simple configuration syntax, you can tell Sanitize to allow certain elements, certain attributes within those elements, and even certain URL protocols within attributes that contain URLs. Any HTML elements or attributes that you don’t explicitly allow will be removed.

CHAO</br>

Leverage ActiveRecord with Non-Database Backed Objects

ActiveRecord comes with a lot of nice things that aren’t dependent on having a database backed model. The most obvious example of this is the validation framework baked into ActiveRecord. Also, there are several plugins which add some useful behavior to ActiveRecord objects but don’t rely on having a database. [more inside]

Scope Columns

ColumnScope to select only certain values from your DB. I often need only single attributes of an ActiveRecord instance. In the past I used something like select_values(SELECT_SQL) or find(:all, :select => SELECT_SQL_FRAGMENT).map! { |r| [r.title, r.teaser]} to conservativly get them. After some time I felt the redundant code tiring and wrote this tiny plugin on top of named scopes. Usage examples: Article.selects(:title_and_teaser).with_author.all # => [<Article ...] Product.ordered_by_name.select_all(:name_and_prize) # => [['Apple Pie', 3.80], ...] You can find the source and more examples in my repository @ github.

In light of the Rails/Merb merge, how DHH is still being a jerk

- The Rails/Merb merge isn’t necessarily a bad idea. But rails-core needs to actually have a conversation about why people (a number of merbists) were so pissed off at the rails community that they left. And that can’t happen until someone acknowledges that there was a legitimate problem.

oh :P rubyflow doesn’t automatically interpret urls. …
Thanks for adding the link, invisible RubyFlow editor! (Peter i presume) :) …
Yesh.. thanks for posting! :)
why is it necessary to talk shit about someone? If DHH wants to make himself lo…

Valid Attributes and Records for Unit/Integration testing

valid_attributes a Rails plugin that produces valid Records and attributes from a given yml file. user = valid User #reord (unsaved) strange_user = valid User, :name=>'Mr Strange' #slightly modified version... Also Included: assert_invalid_attributes, a validation to test all validation rules DRY and with readable output. #--> Failure: User.email expected to be invalid when set to s@sss asser_invalid_attributes User, :email=>[nil,'','s@sss','xx@dd.s'], ...

Run JavaScript (or JRuby) with all the power of desktop Java in the browser

Trephine makes creating ultra-rich web applications easy by bringing the full power of the desktop to the web developer. This is achieved by executing privileged JavaScript code through a tiny (~20kb) signed Java applet. With Trephine you can: read and write from the file system, open sockets for listening, access the system clipboard, and much more. [more inside]

Loading older posts