Displaying 12 results from an estimated 12 matches for "items_control".
2006 Jan 20
1
stack level too deep from has_many / belongs_to relationship
...cord/associations.rb:346:in
`has_many''
#{RAILS_ROOT}/app/models/routine.rb:2
#{RAILS_ROOT}/app/models/routine_exercise.rb:5
#{RAILS_ROOT}/app/models/routine.rb:2
... snip ...
#{RAILS_ROOT}/app/models/routine_exercise.rb:5
#{RAILS_ROOT}/app/models/routine.rb:2
#{RAILS_ROOT}/app/controllers/items_controller.rb:462:in `const_get''
#{RAILS_ROOT}/app/controllers/items_controller.rb:462:in `item_class''
#{RAILS_ROOT}/app/controllers/items_controller.rb:112:in `new''
So this seems to be getting into a recursive loop around the
RoutineExercise belonging to Routine and Routine h...
2007 Sep 18
2
rSpec / Nested Routes / Mocks
..._1002'' received unexpected message :user= with (#<User:
0x..fdb7bcd38 @name="User_1003">)
Any help would be greatly appreciated.
Here''s my setup. Problem line indicated with ******
--routes.rb--
map.resources :users do |users|
users.resources :items
end
--items_controller--
def create
@item = Item.new(params[:item])
@item.user = User.find(params[:user_id])
respond_to do |format|
if @item.save
....etc.....
--items_controller_spec--
describe ItemsController, "create action" do
before do
@item = mock_model(Item, :to_param => &qu...
2006 May 29
2
Adding model fields
...e.rb:1336:in `attributes=''
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.0/lib/active_record/
base.rb:1193:in `initialize_without_callbacks''
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.0/lib/active_record/
callbacks.rb:236:in `initialize''
#{RAILS_ROOT}/app/controllers/items_controller.rb:121:in `new''
#{RAILS_ROOT}/app/controllers/items_controller.rb:121:in `create''
I thought that Rails magically handled new fields. Not so?
What else do I need to do?
--
Posted with http://DevLists.com. Sign up and save your mailbox.
2011 Jan 03
2
Adding style to model (paperclip)
...Base
has_attached_file :photo, :styles => {{ :small => "50x50"},{ :large =>
"150x150"}}
end
it seems to be ok, but when I submit in edit or new views, I get the
following error:
NoMethodError (undefined method `[]'' for nil:NilClass):
app/controllers/admin/items_controller.rb:64:in `update''
app/controllers/admin/items_controller.rb:63:in `update''
Controller code:
def update
@item = Item.find(params[:id])
respond_to do |format|
if @item.update_attributes(params[:item])
format.html { redirect_to(admin_items_path, :notice...
2007 Oct 26
3
Specing with Subdomains as Account Keys
...Any ideas?
(This question was originally posted under "Mocking/Stubbing help
with subdomain as account key"
- http://rubyforge.org/pipermail/rspec-users/2007-October/
004138.html, but I''ve rephrased it to make it more clear with the
subdomain as account key question.)
# items_controller_spec.rb
describe ItemsController, "handling GET /items" do
fixtures :companies
before do
@request.host = "subdomain.test.host"
@item = mock(Item)
Item.stub!(:find).and_return([@item])
@current_company = mock(Company)
@current_company.stub!(:ite...
2006 Jun 21
3
Show Exceptions in Production mode.
Does someone know what to set so that exceptions are shown (to user)
when in production mode? I would like the exception to show exactly as
it does in development mode.
I know that they are written to the log.
Richard
RogueWaveMarine.com
--
Posted with http://DevLists.com. Sign up and save your mailbox.
2006 Apr 04
2
HABTM
...ethod_missing''
/dp/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/=20
associations/association_collection.rb:117:in `replace''
/dp/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/=20
associations.rb:884:in `items=3D''
#{RAILS_ROOT}/app/controllers/items_controller.rb:15:in `select''
/dp/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/=20
base.rb:1786:in `method_missing''
/dp/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/=20
associations/association_collection.rb:117:in `replace''
/dp/lib/ruby/gems/1.8/g...
2006 Apr 17
6
acts_as_taggable confused
Ahoy,
So i''ve installed the acts_as_taggable module and everything is fine,
but i''m a bit confused about this bit of code described in the API
"photo = Photo.new
# splits and adds to the tags collection
photo.tag "wine beer alcohol"
# don''t need to split since it''s an array, but replaces the tags
collection
# trailing and leading
2010 Jul 14
3
`stack level too deep` when overwriting `to_json`
...st (a
particular oddity), I get:
SystemStackError (stack level too deep):
app/models/comment.rb:21:in `to_json''
C:1:in `__send__''
C:1:in `encode''
C:1:in `__send__''
C:1:in `encode''
app/models/item.rb:61:in `to_json''
app/controllers/items_controller.rb:20
app/controllers/items_controller.rb:18:in `show''
C:/Ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service''
C:/Ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run''
C:/Ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread''
C:/Ruby/lib/ruby/1....
2006 Aug 14
0
Automatic helpers for controller modules?
Just wondering, is there a way to automatically include helper modules
for controllers in modules? Something like (which doesn''t work, so I use
''helper :items):
app/controllers/admin/items_controller.rb
app/helpers/admin/items_helper.rb
Joe
--
Posted via http://www.ruby-forum.com/.
2006 May 02
1
Newbie problem with Ajax and render partial
...>
<td width="2%" align="right" id=''rating_box''>
<%= render (:partial => ''rating_box'', :locals => { :item =>
item }) %>
</td>
</tr>
...
_rating_box.rhtml:
<%=h item.rating %>
items_controller.rb:
...
def increment_rating
@item = Item.find(params[:id])
@item.rating = @item.rating + 1
@item.update_attributes(params[:item])
render(:partial => ''rating_box'', :locals => { :item => @item })
end
...
Thank you very much for your help!
--
Posted via http...
2006 Mar 29
0
Intermittent error - undefined method ''destroy_without_callbacks''
...cord/lib/active_record/base.rb:952:in `find_one''
/vendor/rails/activerecord/lib/active_record/base.rb:941:in
`find_from_ids''
/vendor/rails/activerecord/lib/active_record/base.rb:382:in `find''
/lib/item_aids.rb:6:in `get_item''
/app/controllers/items_controller.rb:277:in `version''
/vendor/rails/actionpack/lib/action_controller/base.rb:908:in `send''
/vendor/rails/actionpack/lib/action_controller/base.rb:908:in
`perform_action_without_filters''
/vendor/rails/actionpack/lib/action_controller/filters.rb:355:in
`pe...