Skip to content

{ Tag Archives } rails

Django F() And Q() Objects For Rails

Recently I was browsing

Django
documentation deliberately looking for
some ideas to cross-pollinate to Rails. F() and Q() objects looked like
nice little hacks so I decided to implement [...]

Also tagged ,

Rails Pro Tip: Invoke Command Line Commands From Rails Console

So there you have your command line prompt from Bash/Zsh/cmd.exe and
there is so called

Rails console
which is basically IRB prompt with the Rails application loaded.

[...]

Also tagged

Safe String Interpolation In Ruby

Age-Old Problem

Suppose you want to authenticate user from the login/password entered
on the web from

user = User.first(:conditions => "login = ‘#{ login }’ AND password = ‘#{ password }’")

[...]

Also tagged

Exploring Latest ruby-lib Additions

Recently I was browsing through the NEWS file in the Ruby Subversion repository. Two methods added since the 1.9.1 release to the Enumerable module caught my attention. These two are Enumerable#chunk and Enumerable#slice_before.

The docs for these are not available at http://ruby-doc.org/ so you’d need to go straight to the source code (by using the links [...]

Also tagged ,