Displaying 20 results from an estimated 50000 matches similar to: "form_for not translating into the same controller/action"
2007 Jul 31
1
form_for - over riding the controller that generates the form
Hello,
I am trying to install my login and search forms as default parts of
the layout. This is the code I am using:
<% form_for :user, :url => {:action => ''authenticate''} do |f| %>
<p>Username:<br /><%= f.text_field :username, :size => 30 %></p>
<p>Password:<br /><%= f.password_field :password, :size => 30
2009 Feb 26
0
Using form_for and has_many associations with a controller in its own subdirectory
Hi,
I''m trying to create a Blog in it''s own subdirectory for an E-commerce
site. Everything is hooked up just fine for the basic posting, but
when I try to add Comments, I''m getting all sorts of headaches! I''m
referring to the screencast by Ryan Bates on the rubyonrails.org site.
Basically, my controller is Blog::Comments, in my Blog::Post comment
form I have
2008 Sep 09
2
form_for submit to a custom action
hi forum,
I am new to rails, and i am just getting my hang of things.
Problem,
how do you pass content captured in a form to a custom method?
I have the following form:
<% form_for :message, @message, :url => { :action => ''reply''} do |f|
%>
<table cellpadding="4" cellspacing="5">
<tr>
<td>Content:<%=
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
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|
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
2008 May 12
0
Problems with form_for, STI, and polymorphic routing
I''m stumped on how to get past this. It''s Rails 2.0.2.
I have a class, Show. Using STI, I''m using that as a base class, and
have DayShow and NightShow that inherit from it.
###
class Show < ActiveRecord::Base
end
class DayShow < Show
end
###
In my shows/edit.html.erb, I have:
<% form_for(@show) do |f| %>
However, when I use it with a @show that has
2009 Feb 06
2
Using partials with form_for
hi all
i was wondering whether it is possible to use partials along with form_for
and form_field. following code is not working. is there some error or this
case is impossible..??
*#new.html.erb*
<h1>Enter Details for new Partner:</h1>
<% form_for(@partner) do |f| %>
<%= render :partial => ''form'', :locals => {:partner => f} %>
<p>
2007 Feb 07
2
form_for onsubmit
Is there a reason I can''t find any information on using the onsubmit
attribute with form_for? I''d hate to *gasp* hardcode the form tag in.
chad
--~--~---------~--~----~------------~-------~--~----~
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
2008 Jul 14
5
How can i use link_to_remote with in form_for
Hi
anybody plz help me how can i use link_to_remote with in form_for.. i
tried but no luck... if i use form_tag i can able to use link_to_remote
and made ajax call.but i need to use form_for ....can anyone help me how
can i do with this.Thanks in advance.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are
2007 Apr 13
1
How can I use aggregation objects in form_for?
Say I have a person object which has a aggregation object call
address. The the code to manipulate a form for create a new person
should be:
# new.rhtml
<% form_for :person, :url => {:action => ''create''} do |f| %>
<%= render :partial => ''form'', :locals => {:f => form} %>
<%= submit_tag "Create" %>
<% end %>
2008 Apr 19
1
form_for question
I have a following snippt to make a form.
<% form_for :post, @post, :url => { :action => "create" } do |f| -%>
<%- end ->
What does ":post" and "@post" do respectively?
If my understanding is correct, @post is there because I set "@post =
Post.new" in the action. But I don''t know what ":post " is for.
Tek
2009 Mar 06
1
creating a form_for with field values?
Hey guys,
I''m having a problem creating a form with field values.
I''m using form_for and don''t really know how to access the field values.
I''ve got a table character_attributes and character_attribute_types.
character_attribute_types contains following data:
id name
X hiding
X strength
etc.
character_attributes:
id character_attribute_type_id value
2008 Dec 02
1
form_for with partial using do |@f|
Is it possible to pass this FormBuilder object to a controller and then
back to a partial?
I have a form rendering a partial that i would like to update with a
call to my controller based on user selectable parameters, but when the
AJAX comes back, i get this error message because i cannot pass a form
builder object between the controller and the view:
"undefined method
2009 Mar 12
4
How can I append a text_field_tag to a form_for?
Hello people,
how can I append a text_field_tag to a form_for? When I submit the form
all text_field_tags are not being appended to the params...
--
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
2009 Mar 27
0
How do I return values when using form_for
Hi I am trying to build a simple app where I''m trying to do pretty what
scaffold does. My question is when I am using ''form_for'' how do I return
the id while editing the application like its done in the form_tag
for example
<h1>Editing book</h1>
<% form_tag :action => ''update'', :id => @book do %>
<%= render :partial =>
2007 Feb 17
0
form_for for a hash object?
Is it possible to pass a hash object into form_for instead of an
ActiveRecord object? The only solution I can think of is to modify the
method_missing method for the Hash class? Is there a better solution?
Also, I want to pass a hash object because I use a custom form builder.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this
2006 Sep 28
0
Solved: was Re: Having a problem with form_for
If anyone ever has this problem ...write me :)
Stuart
On 9/28/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> I was using formhelpers before with 3 fields that are dependent
> dropdowns and using some ajax to perform the magic.
> Now that''s I''ve had to switch to form_for I''m finding one of two problems.
> Renaming the
2007 Jul 03
2
"form_for" names fields using brackets = javascript problems
Hi all,
The "form_for" helper and its friends "text_field_for" etc generate form
fields with names like "forum[title]", i.e. using square brackets to
denote attributes on model objects.
Now, for the convenience of the user I want to do some simple
client-side validation to check that some fields have been filled in. So
I am trying to write javascript like
"if
2006 Sep 24
8
form_for and Multiple Models Being Saved
Howdy Folks,
I want to use form_for to allow a user to submit a form that contains two
instances of the same model. They are entering calendar dates and I want
them to be able to submit 2 from the same form.
Ok, so, using form_for, what is the best way to do this? form_for seems to
be setup to handle a single instance in that it wants a name for the
variable, etc...
Has someone else done this?