Displaying 20 results from an estimated 30000 matches similar to: "Form Array Elements Handling"
2006 Jun 20
1
Soliciting suggestions - Form within a Form
Greetings!
I could use some suggestions on how to proceed from where I am to where I want to go.
I''m working on an app that collects info from the visitor and saves it to a file. The file can later be read in for update. To collect the info, the app presents a form with a set of checkboxes. The state of the checkboxes at initial presentation is controlled by a summary record that is
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.
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"
2006 Jul 12
0
Give form elements "fieldWithErrors" class in non-std. way?
All,
I want to know how to force an element of my model to be invalid, but
not generate any message for it, so that the corresponding form field on
a form will show up with the ''fieldWithErrors'' class.
I have some checkboxes on my RHTML form, and they are generated with
this code
<%= check_box_tag("current_job[target_list_ids][]"...etc. %>
target_list_ids
2005 May 11
1
remote tags for form elements (AJAX)
I noticed on Backpack.com that form input elements (the checkboxes)
were making remote calls using onClick.
I couldn''t find this behavior in the API - did I miss something or is
this just a 37signals addition?
- Derek
2006 Sep 06
4
Setting Product Env
When I am using my rails models in my worker class, it appears the
background worker class is always using development no matter what I do.
I set background.yml to production. I even have ENV[''RAILS_ENV''] ||=
''production uncommented in environment.rb. I don''t have the development
db even created on my production box, so not sure where it is getting
development
2006 Aug 07
2
Getting an array of ids from form checkboxes?
Is it possible to set up a list of checkboxes so that the form
parameters are given in an array (eg {"delete_list" => [3,6,7]}) ?
At the moment I''m using
<%= check_box_tag "delete_list[#{post.id}]" %>
...which gives parameters looking like {"delete_list" => {"3" => "1",
"6" => "1",
2006 Apr 19
4
RJS replace_html auto-closing tags
I''m using the following RJS template to spit out a div containing a
list of projects:
page.replace_html ''results'', ''<div>''
@projects.each do |p|
page.insert_html :bottom, ''results'', p.name + "<br/>"
end
page.insert_html :bottom, ''searchresults'', ''</div>''
page.show
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
2006 May 03
7
Business Logic and where to place with rails
I am having an issue of deciding where I should put the business code
for example the more complex code coming off the controller. Right now,
I am just thinking to put it in the ''lib'' directory and the do something
along these lines:
require_dependency "system_process"
class SystemMessageController < ApplicationController
include SystemProcess
...
...
Where
2009 Apr 12
0
rails 2.3 nested forms with has_many through checkboxes
I was wondering if anyone knew of a way to combine the new nested
forms in rails 2.3 with a has_many through relationship via
checkboxes. Basically I have a page model, a page_category model and
a category_items join table. Pages have many page categories through
category items. The category_items table is polymorphic so i can use
it for other models who need categories (maybe this is
2011 May 30
5
rails habtm checkboxes with jquerymobile
Hi guys, I have a habtm association working properly. My application
consists of both a desktop and a mobile version.
My mobile version is made with jquerymobile and I would like my checkboxes
in the edit form to look like the checkboxes shown in
http://jquerymobile.com/demos/1.0a4.1/#docs/forms/forms-checkboxes.html.
My desktop code is the following:
<%= check_box_tag
2007 May 25
3
check box value in array
Hi guys,
I have a group of check box in rails page.
check box Code as below:
<% for count in @total_cellno %>
<input name="checkbox" type="checkbox" value="<%= count %>" />
<% end %>
I want to receive the selected value in my controller model.
@selected_box << params["checkbox"]
I guess that it provides values
2010 Mar 30
0
How to deal with array of checkbox values in Ruby 1.9.1?
In Ruby 1.9.1 strings are no longer enumerable and string.each is
undefined. This causes a problem when parsing values for an array of
generated checkboxes since the field value, when submitted, becomes an
array of strings. For example:
<% for map in Map.find(:all) %>
<%= check_box_tag "listing[map_ids][]", map.id, @listing.maps.include?
(map) %>
<%= map.title %>
<%
2006 Apr 22
0
Checkboxes get reset in sortable element in IE
Hi,
I am creating a list of checkboxes and text using this code:
<% count = 0 %>
<ul id="fields_list">
<% fields_ary.length.times do %>
<%= "<li id=''item" %> <%= count %> <%= "''><span class=''chkBox''> <input
type=''checkbox''></span><span
2013 May 27
3
Ransack, acts-as-taggable-on and checkboxes in search form
need some help on ransack filtering.
I have model Project, which has many tags through acts_as_taggable gem.
Project.rb:
class Project < ActiveRecord::Base
include PublicActivity::Common
belongs_to :customer
belongs_to :category
has_many :attachments, :as => :attachable
has_many :reports, :dependent => :destroy
has_many :messages, :dependent
2006 Apr 23
1
checkboxes for filtered search
I have a page that renders a series of about 20 checkboxes on the
left hand side with content on the right. These checkboxes are
created from a DB and that part is all working well.
What I want to do is have a user click on a checkbox [genres] and
have the content on the right be filtered based on the checkbox
ticked. If a user clicks on more than one checkbox than only those
stories
2006 May 04
22
Should controllers be "smart"?
I''m working on a small project with a friend, and one of the things we
needed to do was send off an email whenever someone signs up an
account. His implementation was pretty simple - throw a
deliver_welcome call inside the controller after the signup. I''m sure
that this is a pretty common thing to do.
The problem, in my mind, was that the app now became tied to two
places -
2006 Jun 08
3
MVC and Pagination
Just wondering how to best integrate with pagination and still stick to
MVC...
Say I have a Post model that has a published attribute. I want to show
all the recent published posts on a page.
My first instinct is to create a method in the Post model called recent
that does the find with proper conditions and order, but the problem I
have is how do I use that with pagination (which definitely
2008 Jan 08
1
HOWTO: Add a new line, Remove new line?
Hello everyone,
I have a couple of checkboxes, where each checkbox belongs to a
specific input field (which has a value). So whenever the user clicks
on the checkbox, each value of the associated input field is added up
and placed in the ''result'' ID. I''m using unobtrusive Javascript to
make this happen...
However I want to able to add and remove a new line (checkbox