Displaying 20 results from an estimated 2000 matches similar to: "can javascript handle 422 response"
2008 Mar 02
2
check_box_tag remote_function
I have a collection of check_box_tags that look like the following:
<% for item in @items %>
<%= check_box_tag "item[item_ids][]", item.id, false, {:onchange =>
remote_function(:url => update_items_path, :with => "''items='' +
escape(value) "} %>
<%= item.name %>
<% end %>
My question is, how do I send all of the current
2006 Jul 31
0
Autosubmitted checkbox
OK - i have this form, and i works perfect :)
<%= form_remote_tag(:update => "status", :url => "/image/worksafe/" +
image.id.to_s) %>
<%= check_box_tag :worksafe, value = "1", checked = image.worksafe%>
<%= submit_tag "Change status", :name => image.sha %>
<%= end_form_tag %>
however - the submit button is kind of annoying,
2011 Oct 18
0
check_box_tag call action on change (AJAX)
Hi all,
I''m developing an application with Rails 3.0.9 and I have a checkbox
and I want to call a function when it is checked/uchecked.
I''m trying with:
<%= check_box_tag "mylabel" t.to_s, false, { :onchange =>
remote_function( :url => { :action => ''update_preview'', :id =>
t.to_s })} %>
in the "show" view and this in the
2006 Aug 01
0
calling controller method for .rhtml file inside directory
Im trying to call a method for an rhtml file that inside a directory.
For example, I have views/some_view/directory_in_view/test.rhtml file.
How do I access this in the controller, I cant have a method called:
def some_view/directory_in_view
end
Do I just have to do a redirect?
--
Posted via http://www.ruby-forum.com/.
2006 Apr 04
6
check_box_tag is limited?
Hello all.
Am I going totally nuts here and just want to check (Natch!) something.
A normal check_box has two value posssibilities. One for checked and one
for unchecked, the value gets submitted with a form.
The check_box_tag on the other hand, has a checked_value (Called just
''value'') and for the unchecked value...nothing, zip, nada.
This means that if you submit a form with
2010 Mar 09
9
Ajax-submit form on "check box onclick ": why this error?
Hi there,
I need to have a checkbox which ajax-submits a form.
The following code throws an error "index 112009 out of string". What''s
wrong here?
==============================================
<% form_remote_tag :url => { whatever_url } do -%>
<%= check_box_tag ''whatever'', nil, whatever, { :onclick =>
2006 Mar 24
2
check_box_tag
hi,
What''s the right way to use the CHECK_BOX_TAG?
I used:
<% for @pippo in @model %>
<%= check_box_tag (:scelta,@pippo) %>
<% end %>
How Can I control if a person choosen the second or third element of the
vector @pippo?
--
Posted via http://www.ruby-forum.com/.
2007 Sep 15
3
check_box_tag always checked
#check_box and #check_box_tag are going to be the end of me. Why is
this always checked?
<% checked = @reservation.selected ? ''checked'' : nil %>
<td><%= check_box_tag("reservation[" + @reservation.id.to_s +
"][selected]", ''checked'', :checked => checked) %></td>
2012 May 08
1
One to many relationships
I was trying to make one to many relationships - between professors
controller to rate_professors controller and used scaffold. it''s
giving me this error-
NoMethodError in RateProfessorsController#index
undefined method `rate_professors'' for nil:NilClass
app/controllers/rate_professors_controller.rb:7:in `index''
Request
Parameters:
2006 May 25
5
Weird Capistrano problem
I''m having problems launching the spin process via the deploy.rb task.
Everything works great when is run the script manually via:
% ssh admin@monterey.example.net /Web/Rails/Example/current/script/spin
However, when I run ''cap spinner'' or ''rake remote:exec ACTION=spinner'',
I get the following errors:
% cap spinner
loading configuration
2006 Mar 27
0
how the check_box_tag works?
I don''t understand the right functionally of the Check_box_tag!.
def check_box_tag(name, value = "1", checked = false, options = {})
can i put as value, the attribute names of a my model?
I would select some model attribute to work.
--
Posted via http://www.ruby-forum.com/.
2006 Jul 06
0
Ajax form results display help
I''m not that familiar with Ajax, so there is a good chance that I''m
doing something incredibly stupid, but here is the issue. I have a
search form that will display results on submit using Ajax callbacks
and cool effects.
Here is the operation that I would like
-User enters data
- On submit of the form, the spinner shows
- If there is an error, the error div is shown and
2006 Jul 11
4
checkboxes with a has_many :through relation
All,
I''m populating a view with checkboxes in a list. I want to be able to
assign to my has_many relationship using the post values of these
checkboxes. Essentially, I want to populate the relationship table
which will create the correct join values in my model.
Here is my check_box_tag code:
<%= check_box_tag("@current_job[target_list_ids][]",
2006 Dec 27
0
HABTM Checkboxes - Adding/Updating Users to a Project
Hello all,
I''m trying to create a HABTM checkbox action that adds/updates ''users''
to a ''project''.
I have the following laid out.
---------------------
TABLES
---------------------
create_table "assignments", :id => false, :force => true do |t|
t.column "project_id", :integer, :default => 0, :null => false
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
2006 Apr 25
0
Need help making code more rails like!
Hi all, I''ve been a PHP programmer for many years and I''ve recently picked
up ruby and rails and am loving it! However, I''m still learning the "rails
way" of doing things and I''ve got a block of code that I think could use a
face lift. Any help, tips, suggestions, you can offer in making it more
rails-like is greatly appreciated. The only thing that I
2006 Jan 23
1
Spawner -p and --port not working?
Hi everyone,
I''m trying to set a port with spawner, and it''s not working:
ruby /var/rails/ldapadmin/current/script/process/spinner -c
/var/rails/ldapadmin/current/script/process/spawner --port=7000 -i 4
-d
spinner: invalid option: --port=7000
Same with -p:
ruby /var/rails/ldapadmin/current/script/process/spinner -c
/var/rails/ldapadmin/current/script/process/spawner -p 7000
2008 Mar 10
1
spinner in form tag?
Hello!
Is it possible to have a spinner in form_tag?
like:
<% form_tag :action=> ''list'', do
:loading=>"Element.show(''spinner'');",
:complete=>"Element.hide(''spinner'');" %>
...
...
<% end %>
If not how could I do it?
Thank you!
--~--~---------~--~----~------------~-------~--~----~
You
2008 Jan 31
3
Handling multiple Check boxes in a XHTML Strict way
Hi,
The default way we handle an array of checkboxes is like this:
<% items.each do |item| %>
<%= check_box_tag ''item[]'', "#{item.id}" %>
<% end -%>
this returns an array item[] that holds the ids of all the items.
Now the real issue:
1. The above loop will same ids to ''n'' items
2. All ids will be ''item[]''
2008 Jun 19
5
observe_field
I have been trying to pass a collection_select parameter and a text field
parameter to observe_field so that it watches both the parameters
simultaneously.
but what i can see is , when i select some value from drop down and dont
write anything in text field its giving correct results.parameters are also
correct passed, but just after that if i write something in text field that
value also get