- if params[:item] # we are dealing with a form with validation errors so fill in the last known value for sub_category
  = f.select :sub_category_id, options_for_select(@options_for_sub_category, params[:item][:sub_category_id]), {}, :class => 'required'
- elsif params[:uuid] # an edit action
...

Ruby Re-populating an ajax popul...

by KJF, October 28, 2010 18:33, 1 refactoring, tagged with rails, ruby

I have a select tag in my v...

A529b78031f700ca2005bdbd1af5ee7b Talk
def format_category_list(sub_categories)
    count = sub_categories.count
    list = ""
...

Ruby Generating a list of 3 entr...

by KJF, August 24, 2010 11:15, 3 refactorings, tagged with rails

I have this function in my ...

A529b78031f700ca2005bdbd1af5ee7b Talk
@merged << @array1
@merged << @array2
@merged.flatten!
...

Ruby Merging two active record a...

by KJF, February 09, 2010 21:28, 2 refactorings, tagged with rails activerecord

I'm merging two active reco...

A529b78031f700ca2005bdbd1af5ee7b Talk