search for: item_url

Displaying 4 results from an estimated 4 matches for "item_url".

2006 Aug 05
5
RESTful Nesting issue
I?m having a strange issue with nested routes though, and was wondering if anyone could shed some light on this? If I have: map.resources :users do |users| users.resources :items end When I try to call <%= link_to_remote ''Delete'', :url => item_url(@item), :with => "''_method=delete''", :confirm => ''Are you sure?'' %> >From inside the user url http://localhost:3001/users/1/items Or edit_item_url(@item.id) it doesn?t always render the correct URL, and sometimes I get a nil error tryin...
2007 Sep 18
0
Help with RESTful named url options
I''ve found quite a few posts on the subject, but no satisfactory answers. Maybe Rails just doesn''t support this yet. How do I create a url with a named RESTful route that also has parameters? I want to write this: link_to_remote "Show Details", {:url => item_url(@item, :details => 1), :method => :get} And get this: <a href="#" onclick="new Ajax.Request(''http://localhost/items/1? detail=1'', {asynchronous:true, evalScripts:true, method:''get''}); return false;">Show Detail</a> Instead...
2007 Sep 18
2
rSpec / Nested Routes / Mocks
..._with_successful_save ***** @item.should_receive(:user) @item.should_receive(:save).and_return(true) post :create, :user_id => 1, :item => {} end it "should redirect to the new course on successful save" do post_with_successful_save response.should redirect_to(item_url("1")) end --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe...
2009 Mar 08
0
undefined variable or method in form_tag url
...create @item = Item.new(params[:items]) @topic = Topic.find(params[:topic_id]) @item.topic = @topic @item.position = @topic.items.size respond_to do |format| if @item.save flash[:notice] = "Item was successfully created." format.html { redirect_to item_url(@item.topic,@item) } format.xml { head :created, :location =>item_url(@item.topic, @item) } else format.html { render :action => "new" } format.xml { render :xml => @item.errors.to_xml } end end end Where is the problem? Any clues? Also...