search for: foods_controller

Displaying 2 results from an estimated 2 matches for "foods_controller".

Did you mean: moods_controller
2006 Feb 24
1
Help a n00b?
...t; <td class="num"><%= text_field ''food'', ''protein'' , "size"=>5 % ></td> <td><%= submit_tag "Add" %></td> </tr> </tfoot> and here''s the relevant code in foods_controller.rb def create_with_ajax @food = Food.new(params[:food]) if @food.save render_partial "list_stripes" end end I''ve got a _list_stripes.rhtml partial that creates the table. The crazy part is that when I try creating a new item I...
2011 May 27
14
[rails] undefined method `model_name' for NilClass:Class
Never seen the error above before, code: describe "edit action" do it "edit action should render edit template" do food = Food.create(:name=>''mooo'') # Food.any_instance.stubs(:valid?).returns(true) get :edit, :id => food.id response.should render_template(:edit) end end -------------- next part