Displaying 20 results from an estimated 8000 matches similar to: "Soliciting suggestions - Form within a Form"
2006 Jun 20
6
checkbox_tag outside a form?
Is it possible to use checkbox_tag outside a form? I''ve put it in a view and it renders but I get nothing back in the params hash. Is there a way to get the value? Like maybe with some JS onsubmit to populate the params hash myself?
Thanks,
Bill
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2006 Jul 03
9
checkboxes
in the mean time i am using a checkbox like this :
<input type="checkbox" name="var[car]" <%= var.car ? ''checked'' : ''''
unless @var == nil %> />
but i am sure there is something better than this in rails like
<%= checkbox_tag ''var'', ''car'', :checked => true %>
but this is not
2006 Jul 24
2
:disable_with for button_to ???
With form_tag submit buttons I use the " :disable_with => ''button label while processing'' " option so that visitors with slow connections aren''t able to submit forms twice.
How do I do the same thing with button_to?
I''ve got several pages where there are multiple forms on the page being updated with Ajax so I can''t wrap the whole
2006 Jun 27
2
Bug in Firebug or in RJS? Or something else?
I''m getting a really strange result using RJS page.replace_html and wonder if anybody knows anything that could help me figure it out.
I''m rendering a partial in a loop in edit.rhtml that puts a set of <div>s on the page, each <div> containing a checkbox_tag with an associated observe_field and a text_field_tag also with an associated observe_field. When the
2006 May 18
6
Form actions with additional parameters
Hiall,
I want to give the action of a form an additional parameters but can''t
figure out how to do it. My code looks like this
<%= start_form_tag :action => ''create'', next_step => true %>
<%= render :partial => ''user_form'' %>
<%= render :partial => ''community_form'' %>
<%= submit_tag
2007 Feb 24
2
RESTful PUT and button_to
I''m working on a RESTful app, and I''ve hit a snag. Here''s a
simplified example of the problem. (Excuse me if this example code
isn''t strictly correct; I''m typing from memory.)
Suppose I have a table which models a simple counter. It has a single
column, "count":
class CreateCounters < ActiveRecord::Migration
def self.up
2006 Mar 25
5
button_to with image?
I''m trying to use button_to and have it use an image in place of the
submit button. I had figured it would work the same as link_to like so:
button_to(image_tag("editicon", :size => "16x16", :border => 0), :action
=> ''edit'', :id => person.id)
but this instead displays the image code as the button name. Surely
there is a simple way to
2006 Jan 20
1
form_tag and multiple buttons inside problem
Hi, I have a bit of a problem with a form in rails. Well, the problem really is
me not fully understanding the mechanism of the form_tag, so here''s what i try
to do:
The idea is to present a some edit fields for some @product attributes and then
present a table showing the @product.pieces (pieces for every @product) and to
include a "Edit Piece" and "Delete Piece"
2005 Aug 19
0
Form.Element.getValue for checkboxes and radios?
I notice that Form.Element.getValue() takes a single element or id and
returns the element name and value. How does one handle getting the
values of checkboxes and/or radios which share the same control name,
save getting them one at a time?
<fieldset>
<legend>Medical History</legend>
<input name="history_illness"
type="checkbox"
2007 Sep 04
2
How can i add a confirmation dialog to a submit_tag?
When i use button_to or link_to, i can easily request a confirmation
dialog with (for example)
<%= button_to "Delete this story",
{ :controller => "story", :action => "delete", :id => @story.id },
:confirm => "Delete story: are you sure?" %>
I also want to do this for the submit buttons on my forms, which are
2011 Oct 21
20
How to transform my html form into a rails 3 form
Hi,
I have the following code working in a rails 3 view, but it is
unfortunately not pure rails code!
<% @filter1 = "tr.show1,tr.show2" %>
<% @filter2 = "tr.show1" %>
<% @filter3 = "tr.show2" %>
<form>
<p>
<input type="checkbox" value=<%=@filter1%> onclick="$
(this).is('':checked'')
2009 Oct 06
1
Problems Processing multiple form elements generated by javascript actions
Hi all,
After many days of struggling, I have a multi-model form with ajax
elements more or less working, but I''m hitting a wall with a few bugs
that I can''t figure out. Guidance would be very much appreciated.
I''m using the Ryan Bates technique from Advanced Rails recipes to
dynamically add and remove elements on a multi-model form.
2006 Jan 08
4
scaffold uses link_to for destroy
Hi,
I wonder why scaffolding uses a link_to tag for the destroy links.
Seems like these should be POST requests with button_to. The Rails
book dedicates pages 335-337 to this very issue.
Peter
2006 Jun 30
5
If / Else Form layout question.
Hello all,
I''m using the following _form.rhtml layout for a number of pages,
including edit record and new record (which each has it''s own definition
in the controller).
I''d like to display a different author form field depending on which
page they are using. I''d rather keep using _form.rhtml as a layout
template, instead of customizing each separate page.
2006 Jul 20
5
Need HELP changing link_to_remote to a button
I would really appreciate some help with changing a link_to_remote call to a button of some sort. Here''s a little background.
On the page there are two <div>s. One is a form that lets the visitor enter items. The second <div> is where the entered items get displayed, each in it''s own item <div>.
Each item <div> has two <span>s. The first one
2006 Aug 11
1
how is form data sent to the conntroller?
I''m trying to implement a bunch of checkboxes whose value I need to use
to process more code without updating the db.
This is my code to for the checkbox in my view
input type=checkbox id=<%=search.name%>_selected
name=<%=search.name%>[selected]>
I guess my question is, when I''m back in the controller, how do I get at
the actual value (checked or unchecked)? It
2007 Dec 28
1
Rake routes & console showing one thing, app doing another
OK, I have a routing problem, that seems to be working in the console,
and with rake routes but not in the app.
I have people that have nested tasks, like so:
-------------------------------
# routes.rb
map.resources :people do |person|
person.resources :phone_notes
person.resources :documents
person.resources :tasks, :member => {:complete => :put}
end
map.resources :tasks, :member
2006 Aug 18
4
Button on view
Hi,
I have a page containing 3 views (2 are partials). One of the partials
needs to have a button that will clear a table called "messages" in the
database.
I can put a button like this "<%= button_to "Clear Messages", :action =>
''clear_messages'' %>" and have the controller do "Message.delete_all".
But the problem is that the
2005 Nov 22
3
Idiom for submit button?
What is the rails idiom for submit buttons on forms?
All other field types have helpers, but button_to creates its
own form, so should not be used. I''ve looked in "Agile Web Dev. with
Rails" but can''t see what I should do instead.
Is this "difficult" because it runs counter to AJAX type forms?
And, related, is there a way to ensure that hitting return in
2006 Mar 14
6
How to provide 2 actions to a form?
Hi,
I have a form in rhtml. Now I have 2 buttons indside that form. Clicking
on the first button action will be ''create'' & on second button action
will be ''delete''. How to do this?
Thanx
Prash
--
Posted via http://www.ruby-forum.com/.