- We’ve set up a Pivotal Rubyforge Project! Keep an eye out for code from us.
nil.controller_name_error deep in the rails framework…” We ‘fixed’ this with a variation of this patch: http://dev.rubyonrails.org/ticket/6199
abort()method will terminates the request in the browser and prevents any callbacks from being invoked. But, your server might still be chugging away on the requested action.
_and_is reserved for methods such as find_by_name_and_address.
If you are missing the Rspec gem, you specs will fail silently. It’s a good way waste a few hours trying to figure out what’s wrong.
ActiveRecord::Base.destroy_allcan really slow down tests. Plus, some feel it’s a bit hacky to set up your test’s preconditions by nuking all of the existing data.
One project has been importing large amounts of pre-formatted text out of a 3rd-party database and wanted to display it on a site with as little effort as possible. The best solution was to display it as pre-formatted with the
<pre> tag, but also tell the browser to word-wrap it so it doesn’t all display as one big line:
font: 12px verdana;
The tubes are clogged! We are doing a lot of remote pairing with <a href="http://www.skype.com/">Skype</a>, <a href="http://www.tightvnc.com/">TightVNC</a>, and <a href="http://www.adobe.com/products/acrobatconnectpro/">Adobe Acrobat Connect</a>, all of which really sloooooooooooooow down your network.
:dependent => :destroyto cascade deletes, make sure you test them well! This really saved our bacon during a major rafactoring.
<%= link_to_function('Link Name', "$('form_id').submit()") %>
Latest news from the “cool new stuff” front:
<code> # Project structure app/ views/ users/ account.rhtml # will be rendered by default account.rjs profile.rhtml # will be rendered by default profile.rjs </code>
Both “account” and “profile” have RHTML and RJS templates. The following code will dictate which is rendered.
<code> class UsersController def account # account.rhtml will be rendered by default end def profile # explicitly render the render the RJS template render :template => "users/profile.rjs" end end </code>