Looking for method "l" and "t"

ziemek Mar 14, 2011 1 thank

translate # Lookup text translations localize # Localize Date and Time objects to local formats

These have the aliases #t and #l

look at ActionView::Helpers::TranslationHelper

:method => :delete, etc.

wiseleyb Mar 7, 2011 1 thank

If you're upgrading to Rails 3 you'll need to make sure you include rails.js (which is in public/javascripts when you rails new someproject) You'll need to include it after prototype. And you'll need to have a 1.7 version of prototype.

When you do a link_to "Delete", @some_obj, :method => "d...

String#crypt uses your platform's native implementation

gabetax Mar 3, 2011 1 thank

Which cipher types (specified through the salt argument) are available will depend on what your platform natively supports. It should be noted that OSX up to at last 10.6 only provides the regular DES cipher. On most Linux platforms, however, you should have access to the following:...

Agree with Oleg

richdrich Mar 3, 2011

Yes, the only way round this seems to be to code e.g:

postArgs = { 'table[field]' => value, 'table[f2]' => v2 }

after the fashion of the browsers form definition.

This lets you do nested attributes as well, e.g: postargs['table[children_attributes[0][field]'] = value

Perfectly applicable

nZifnab Mar 2, 2011 1 thank

@rkh You would be correct if this code had occurred in a subclass who's parent method was being overridden.

However, defining the method in this manner is completely removing the old method - as if you had written code like this:

class MyClass
def do_something
  puts "We're doing some...

How to deal with Missing host to link to!

stevo Mar 2, 2011

You just need to define default_url_options[:host] in your class. The easiest way to do it:

class SomeClass include ActionController::UrlWriter default_url_options[:host] = YourApp::Application.config.action_mailer.default_url_options[:host]

def some_method

some_superb_url(maybe_ev...

Using namespaces

javiervidal Mar 1, 2011 2 thanks

If you are using a namespace in your routes.rb, for example:

namespace :admin do
resources :products
end

then you can:

url_for([:admin, @product])

and:

url_for([:edit, :admin, @product])

flags

annaswims Feb 28, 2011

from 'man recvfrom' The flags argument to a recv() function is formed by or'ing one or more of the values:

MSG_OOB        process out-of-band data
MSG_PEEK       peek at incoming message
MSG_WAITALL    wait for full request or error

The MSG_OOB flag requests receipt of out-of-...