similar to: namespace + nested resources = <% form_for ... %> problem

Displaying 20 results from an estimated 30000 matches similar to: "namespace + nested resources = <% form_for ... %> problem"

2007 Dec 28
1
Nested resources form_for problem
Hi, I have a resource map like this: map.resources :users do |user| user.resource :sreg10record end So a User is supposed to have (at most) one Sreg10record. The problem is in the views. I tried following this tutorial: http://www.akitaonrails.com/2007/12/12/rolling-with-rails-2-0-the-first-full-tutorial which proposes something like: <% form_for( [@user, @sreg10record] ) do |f|
2010 May 23
1
[Rails 3] Trouble with named routes and form_for
Hi guys, I''m having trouble getting named routes and form_for to play nicely in quite the way I would expect. Here''s a quick summary of what I''ve got going on: Named route: resources :thread, :class_name => "forum_thread" Controller name: forum_thread_controller Model object: forum_thread In both my new and edit actions I''m setting up an
2009 Jul 01
1
form_for resources with :singular specified
I fully suspect that I''m missing the point here somewhere so I promise I won''t be offended if you tell me I''m being daft. My application rents equipment ... not equipments. So I have the following: map.resources :equipment, :singular => :equipment_instance class Equipment < ActiveRecord::Base class EquipmentController < ApplicationController The
2010 Mar 24
0
form_for with nested shallow route
Let''s say I have: map.resources :teams do |team| team.resources :squads, :shallow => true end When I want to generate a form_for a squad, I need both the team and squad for new/create, but only the squad for edit. This means I need: edit: form_for(squad) new: form_for([team, squad]) This seems not very dry. Is there a more idiomatic way of doing this? Right now,
2010 Feb 22
1
form_for redirect to another controller
I have 2 controllers foo, bar and I''m using searchlogic gem to search products inside both controllers. All works great but I want to implement now custom form_for from foo view to search products for bar controllers, how to do this ? I try something like this: <% form_for @search, :url => {:controller => "bar", :action => "index"} do |f| %> but its
2013 May 23
1
problem of respond_with working on nested resources
hi all: when using namespace or nested resources in routes.rb,such as "namespace :admin { resources :books }, we can use [:admin,@book] way to generate path. It works fine in form_for , but when I use it with respond_with in controller, I get problems. The problem is when I put following code in controller: def create @book=Book.find(params[:id])
2013 Mar 06
1
How to create multiple submit paths for form_for?
I''ve been researching this for some time and there doesn''t seem to be an easy solution. I have a form_for that submits materials. As usual, when it edits an existing material it automatically goes to the update action. This is fine. However, I want to have a second submit button "Save As" that allows a user to save another version of the material. This second
2011 Dec 17
7
How to fire Ajax call from Form_for
I am learning Rails 3 and need some help on Ajax part. I am trying to accomplish the following: There is a textarea on the page which has a length of letters constraint, say 100. Every time a symbol is typed there,a nearby label tells you how many letters you have left. I plan to use Ajax to do this. I googled for a few hours and could not figure out how to do this. So far what I have done is
2011 May 27
4
undefined method `model_name' for NilClass:Class in a form_for
Hi! I know that there are other topics about this issue, I read them and I''m always blocked. Here is the error message: undefined method `model_name'' for NilClass:Class Extracted source (around line #30): 27: 28: <h2>Add Translation</h2> 29: 30: <%= form_for @new_trad do |f| %> 31: Locale: <%= f.text_field :locale %> 32: Key : <%=
2010 May 19
2
customized form_for in ApplicationHelper
hello, I want to make a table within a form by making a new form_tag. The following code in ApplicationHelper fails: def tabular_form_for(name, object = nil, options = nil, &proc) concat("<table>", proc.binding) form_for(name, object, (options||{}).merge(:builder => TabularFormBuilder), &proc) concat("</table>",
2013 Mar 13
2
Form_for text_area
Hi all, Since I am new to ruby on rails. I''m stuck in some minor issue. I am using form_for in my view. In that I am using a text text. So, My question is, how to add a default value to the text_area along with the row and col values. Please help me out ASAP. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To
2011 Mar 04
1
form_for_tag - difference between that and form_remote_tag and form_for?
What''s the difference between form_for_tag and form_for? And between form_remote_for and form_remote_tag? -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe
2010 Nov 01
2
form_for .label class
Hi, Could anyone tell me what I''m doing wrong below when trying to apply a style to the following label and text field <div class="group"> <%= f.label :name, :html => {:class => "label"} %> <%= f.text_field :name, :html => {:class => "label"} %> </div> Doesn''t work at all, the form however picks
2010 May 26
6
Understanding Form_for
OK, so I''m an absolute noob at Ruby on Rails. I''ve read a lot of information I can find about form_for and most of them use form_for to create new items that get saved into the database and can be viewed later to edit, destroy, etc. In this case, the database will fill up with whatever the user wrote and I just want my program to have no information stored. I''ve been
2006 Oct 13
2
form_for() and name
how can i give name attributes for form_for(), so it will give an output like <form name="f">. it is because that i need to access the form name for javascript manipulation. as far as i know, name can only used in form_tag(), but i currently have more than 50 forms that built using form_for(). the structure is like this: <% form_for symbol, item, :url => { :action
2006 Apr 25
7
undefined method form_for ?
Seems the only issues I ever have with Rails are these bizarre fiddly little things that make no sense. Can''t for the life of me understand why I''m getting undefined method on form_for in a view? And it''s actually part of the acts_as_authenticated plugin that''s doing it. But how can it not know about form_for? -- Posted via http://www.ruby-forum.com/.
2010 Mar 06
7
form_for, submit, and parameters disappearing
Consider the following: -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to
2006 Aug 02
7
form_for not working with Markaby
I''m playing around with Markaby and I decided to write a little blog app. I''m running into issues with forms however. If I use form_for the output of the form gets swallowed. For example: form_for :article, @article do |f| f.text_field :title f.check_box :published f.text_area :description f.text_field :pub_date f.text_area :content end gets rendered as an empty form
2006 Aug 05
1
form_for and partials
I''m getting an error in the partial when i try <% form_for :name do |form| %> <%= render_partial "#{@current_stage}" %> <% end %> So I assume that form_for does not have scope in the partial? If that is the case what are my solutions... Do I have to stick a <% form_for in every partial, or do i just change all my inputs back to text_field
2009 Aug 11
5
Dynamic drop-downs in a form_for using AJAX remote_function - Help
Hello - I am fairly new to Ruby on Rails, but feel like I am learning quick. I have what seems to be a fairly unique issue as I cannot find much out there that describes what I''m seeing. Hopefully it''s a very simple fix, and I simply can''t see the forest through all the trees! I am attempting to create 2 related drop-down lists in the same form_for, both using