graphs with rails
[nuby on rails article on gruff)[http://nubyonrails.com/pages/gruff]
codes a lot
If the code is inexplicably missing from some of my posts it is because gist.github.com is down at the moment. Check back a little later.
[nuby on rails article on gruff)[http://nubyonrails.com/pages/gruff]
The way to do autocomplete in rails 2.0 is to use a plugin. The text_field_with_auto_complete feature is deprecated.
Do script/plugin install auto_complete
It?s also here
The plugin seemed to have some issues (as in it DID NOT work). This guy had a good fix which I copy and pasted over the standard file in my lib folder of plugin, and here?s where I linked off from. The issue seemed to be related to the protect_from_forgery key.
This is pretty easy, but I always seem to forget (see comment):
<%= @post.author.name rescue "no author" -%>
Give the file a name in the lib folder and then in the environment.rb file do a: require ?libfilename?
simple, huh?
Use acts_as_ferret
I had serious trouble with adding conditions to acts_as_ferret in order to query only for a certain user_id. You have to do the following with the little {}
@records = Record.find_by_contents params[:search], {}, {:conditions => ["user_id = ?", current_user]}
And to run it on a production server - go here
Rails 2.0 pagination - it?s best to go ahead and use the will_paginate plugin
this is the most up to date - April 4th, 2008. He moved it to a git repository or his github
You can also combine it with a simple search form - see Ryan?s episode 37 though this won?t be too hot for most things. You need full text search. For that possibly use acts_as_ferret
To get link_to_remote to work on rails 2.0 / RESTful routes, you need to add :method => :get to link_to_remote. For example
<%= link_to_remote "e",
:url => edit_record_path(record), :update => 'test', :method => :get %>
To get link_to_remote to work on rails 2.0 / RESTful routes, you need to add :method => :get to link_to_remote. For example
<%= link_to_remote "e",
:url => edit_record_path(record), :update => 'test', :method => :get %>
The following are some links to do natural language date selection with rails. I recommend going ahead and using chronic, but take a look at Ryan Bates solution for good measure.
semi-solution - date-time-text-field-helpers