Displaying 20 results from an estimated 2000 matches similar to: "Framework question about FormHelper ..."
2007 Apr 16
6
How to use a form.check_box ?
Hey guys,
I''m trying to have a simple webform in my administration section to
add a user. I have the text_fields for adding the user''s name,
password, and password confirmation, but cannot seem to figure out the
checkbox. I want it to be a single checkbox, that if clicked, will set
the database column "access" to be "admin" and if its unchecked, set
it to be
2006 Apr 08
2
ActionView::Helpers::FormHelper instance methods should take an object reference rather than an object_name.
Hi
ActionView::Helpers::FormHelper methods (e.g. #text_field,
#check_box...) take object_name as an argument. From this argument
they infer a name that is supposed to contains the reference to the
relevant object.
I can''t see why the FormHelper methods were designed that way.
Compared to simply passing them a reference, the current way seems too
complicated and an invitation to problems
2005 Dec 19
0
ActionView::Helpers::FormHelper.text_field
Hi,
Is it possible to use the ActionView::Helpers::FormHelper.text_field with an
instance variable instead of a model. e.g.
In the controller:
def meth
@value = ''hi there''
end
In view:
<%= text_field ''value'', nil %>
It doesn''t work with what is above (doesn''t like the nil) and produces very
strange results replacing nil with
2012 Sep 08
0
:index => nil
On here:
http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-check_box-label-Gotcha
you see this code:
<%= fields_for "project[invoice_attributes][]", invoice, :index => nil
do |form| %>
<%= form.check_box :paid %>
...
<% end %>
why are they using :index => nil in the example? I mean I know that
what it does is ensure that the
2006 Jan 21
5
How do you deal with non-model property form values
I have a User ActiveRecord model that has email and password properties. I
want to build a login for that has a "remember me" option. My view looks
like this:
<% @page_title = "Login" -%>
<%= error_messages_for ''user'' %>
<%= form_tag %>
<table>
<tr>
<td align="right" width="1%"
2007 Jan 09
1
assert_redirected_to not working as expected
I''ve installed the "acts_as_authenticated" plugin and made some
modifications to the controller (app/controllers/account_controller.rb)
"signup" module as follows:
===
def signup
@page_title = ''Create Account''
@user = User.new(@params[:user])
if request.post?
if @user.save
session[:user] = User.authenticate(@user.login,
2006 Oct 15
2
Getting check_box to default to checked?
I''ve tried this (in a new method/template -- so @type doesn''t actually
exist yet):
check_box ''type'', ''notify_on_create'', {:checked=>''true''}
But :checked seems to get swallowed. I''ve also tried setting
notify_on_create to true in the Type model, but that doesn''t work
either. Any way to get the
2012 Sep 08
4
dash symbol
In the example below, what is the dash doing between the class
attribute and array:
(field_helpers -
[:label, :check_box, :radio_button, :fields_for, :hidden_field, :file_field]).each
do |selector|
--
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
2006 Apr 24
12
pass checked boxes to controller
Noobie question here. :)
I have a form with check boxes on them. I simply want the user to check
the appropriate boxes, click the action (Add Visits). It''s my
understanding, that these check box values go into a hash
(add_visit_for_this_Pt), but I can''t seem to get this hash back to my
controller for processing. Below is my form.
Basically, all the controller is
2006 Apr 04
4
Anyone noticed slow rendering performance with formhelpers?
It seems like the form helpers, such as "link_to" and "check_box" really
slows down rendering when you have hundreds of rows.
Has anyone else noticed this?? Is there a way to go around it apart
from typing the raw html?
--
Posted via http://www.ruby-forum.com/.
2006 May 01
3
Make a checkbox checked based on a condition?
I have a series of checkboxes in a form generated as follows:
<% for user in @active_users %>
<p><%= user.firstname + " " + user.surname%>
<%= check_box ''assigned_tasks'', ''user_id'', {:index => user.id},
user.id, nil %></p>
<% end %>
I''d like to have one of them selected when user.id is equal to the
2006 Feb 21
1
formhelper methods don''t work with render collection partials
I''m rendering a partial using a collection:
<%=render(:partial=> ''record'', :collection => @records)%>
Inside the partial, I''m attempting to create a new form for each row,
generating elements like the following example:
<%= text_field "record", "name" %>
However, though my objects are fully populated, these form tags
2010 Feb 20
1
formhelper password_field only takes two arguments
When I look at the docs, password_field seems to take 3 arguments.
So when I ''play around" with things and I attempt to pass three
arguments to password_field ... I get an error saying that it only takes
two parameters ("3 for 2")
I am totally lost.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups
2006 Jun 02
3
Advice, why value_before_type_cast in FormHelper?
I am wondering why is in creating text fields with form_helper used
value_before_type_cast instead of attribute value for field value?
I set rails enviroment so date fields are in european format
(dd.mm.yyyy) and would like to have same format in forms, but because of
value_before_type_cast is called, form fields are filled with
''yyyy-mm-dd'' or timestamp integer, etc.
2006 Aug 09
2
How do you define a method
Hi all,
I was wondering if anybody could help me figure why a view cannot find a
method that I defined in another class. I do this in the view: (let''s
say index.rhtml)
<%= check_box("item_search_page", "method_name")
Here, item_search_page is a variable in the view''s controller, which
creates a new ItemSearchPage object. And I defined
2006 Apr 18
2
check_box
I''ve got a question on the use of check_box.
***
This is working but there just has to be a better way:
RHTML:
<% for book in @books do %>
<tr>
<td><%=book.label%></td>
<td>
<%checked = book.subscribed ? ''checked'': ''nope''%>
<%=check_box("book" + book.id.to_s,
2006 Nov 04
0
Check_box woes
I have a User model and an Address model.
A user has_many addresses, and an address belongs_to a user.
An address object for a user could be a billing, shipping or marketing address.
The way I''m tracking this is via the user attributes:
billing_adress_id, marketing_address_id and shipping_address_id in the
user table, which holds the relevant address id.
But in my form that allows a
2015 Feb 17
0
[Bug 28095] X crash with PFIFO_CACHE_ERROR. (Nouveau on Riva TNT).
https://bugs.freedesktop.org/show_bug.cgi?id=28095
--- Comment #15 from Brent <bzipitidoo at hotmail.com> ---
Yes, someone else said that hardware was unusual. But Nouveau did work with
it, at elast somewhat, in the later 2.6 kernels. If it helps at all, the
Diamond Viper V550 video card reports a version of 1.93E during POST.
Tried older versions of Puppy Linux, and ran into other
2006 Jun 07
5
check_box:how to update 2 checkboxes dependent on each other
I''ve got the following problem,
I''ve created two check_boxes in my view. The user has to select one
check_box,
but isn''t allowed to seth both of them together on true. Now i am
looking for functionality that can help me doing the folling:
Scenario 1
CheckBox1 = True, The user sets CheckBox2 from False to True, now
CheckBox1 should automatically become False.
2007 Dec 16
0
Integration Testing - hang with post parameters
I''m getting some weirdness with integration testing. The following
works fine if I don''t have parameters, but as soon as I add parameters I
get a hang. Not sure exactly where it is hanging.
NO HANG
post ''user/register''
HANG
post ''user/register'', :user => {:name => ''John Doe'', :email =>