Displaying 20 results from an estimated 10000 matches similar to: ":maxsize => 30 in form not working"
2006 Jul 07
8
Possible name clash?
Scenario:
Table in database has two fields, id and category (table name is:
categories)
Controller is named category_controller.rb
Model is named category.rb
Helper is named category_helper.rb
Form is named list.rhtml in view\category directory
The code in play on the form is (from generating scaffold):
<% for category in @categories %>
<tr>
<td><%=
2006 Jul 08
2
Trouble getting select to work
I''ve tried pulling this together from examples in the book, searching
the web and this list, but so far I''ve not been able to get it working
just right.
My table is a categories table with id and category fields.
My form has the following:
<td><%= select(''category'', ''category'', @categories = Category.find(:all,
:order =>
2006 Apr 05
25
How to avoid bunch of <% %> ??
Hello, I would like to know is there is a way to avoid poluting the
views with tons of <% %> ?
Like this
<%= start_form_tag() %>
<%= text_field_tag(''category[title]'', category.title, {:size => 20,
:maxlength => 128}) %>
<% if not category.parent_id.nil? %>
<%= select("category", "parent_id",
Category.find(:all,
2006 Mar 26
4
Updating query results in real time with AJAX
I have the following view template:
<%= form_remote_tag :update => "new_item",
:url => {:action => ''create''},
:before => %(Element.show(''spinner'')),
:success => %(Element.hide(''spinner'')) %>
<div id="new_item">
</div>
2006 Jul 06
4
ERb question: Embedding <%= %> in helper method calls
I had a situation where I wanted to use a <%= %> (scriptlet) in my
text_field call to set the "disabled" attribute on the text field, like
so:
<%= text_field(:current_job, ''removeLinkPos'', :value => '''', :id =>
''offset'', :maxlength => 2, :disabled => <%= sometest ? ''true'' :
2006 Jun 13
2
Custom Primary Key, Using Primary Key in Form "gives before_type_cast" error?
Hi guys,
I''ve got a problem here which i need help from the pro''s in this mailing list
I have a legacy app where the User table has a custom structure where
"User_id" (username) is the primary key as well as the username used
to log in
User.rb (model)
class User < ActiveRecord::Base
set_table_name "cmf901"
set_primary_key "user_id"
end
2006 Apr 25
2
Noob Question: REgarding Forms ( Take 2 )
I''m hoping there''s an easy way to do this. I''m trying to read options
from a database, and insert them into form tags. So for example,
In the Database Table: options
size: 300
type: text_field
maxsize: 300
and I want to create a text_field form tag, with all the appropriate
options, is there an easy way to do this, other than having the code
output the HTML
2007 Nov 18
2
Variable inside of another variable
Hi everyone,
I''m building partial and I need to use a variable inside of another
variable name:
I''ve tried like this:
<div class="form_row">
<label for="<%= field %>"><%= field_title || field.humanize %>:</
label>
<%= form.text_field field,
:size => User::field.upcase_SIZE,
2008 Jan 16
4
ActionController::InvalidAuthenticityToken in LoginController
Hi,
I''m having a problem trying to get a login controller working. When I
try and post to my login controller I get the following error:
ActionController::InvalidAuthenticityToken in LoginController#login
login_controller:
class LoginController < ApplicationController
def login
case request.method
when :post
if @session[''user''] =
2006 Jan 13
9
form_remote_tag breaks inside table
i guess its better form to keep form tags outside of table tags anyways,
but it took a lot of trial and error to figure out thats why @params
were no longer showing up after switching form_tag to form_remote_tag.
not sure if this is a prototype ''bug'' or ''feature'' or what. but my next
step was to switch to a seperate form tag for each row to reduce
needless
2006 Feb 02
4
Doubts on validation
Hi All,
View
********
<tr>
<td><b>Student: </b></td>
<td><%= text_field "student", "fname", "size" => 40, "maxlength"
=> 40 %></td>
</tr>
<tr>
<td><b>Program: </b></td>
<td><select id="student_program_id"
2006 Apr 06
10
Advice needed on tracking down unusual error
Does anyone have advice on how to go about locating the cause of this
error message:
ActionView::TemplateError (wrong number of arguments (3 for 1)) on line
#4 of app/views/products/search.rhtml:
4: <%= start_form_tag :action => ''search'' %>
I don''t see anything wrong with line 4 above.
Some background: I''ve made a number of changes to Controllers,
2006 Jan 01
4
Agile book deltas
Are there deltas for the revisions of the PDF version of the Agile book?
-- fxn
2006 May 22
6
how HTML_Option works?
Hi all,
all the form helpers can take a serie for options but I cant find any
documentation about them. Any one can point me toward one?
Or at least tell me how I can for example add a function that would be
call with the onblur event from a input box?
Thanks!
--
Posted via http://www.ruby-forum.com/.
2006 May 09
1
Reusing a model to form and link_to.
Hy guys,
Inside my app I have a form which contains user information.
Sometimes a have a form with a text_field as above:
<%= form_remote_tag(:html => { :action => url_for(:controller =>
"my_controller", :action => "my_action") }) %>
<%= text_field(''my_object'', ''my_parameter'', :maxlength =>
2006 Feb 25
2
How to access param entered through text_field
I''m rendering partial a form comprising several text_field helpers to
maintain my User model. For example, the email field is:
<p><label for="user_email">Email</label><br/>
<%= text_field ''user'', ''email'', :size => ''40'', :maxsize => ''256''
%></p>
In my controller,
2010 Dec 14
4
Custom form error messages
Hi,
What do I have to override in order to be able to have the error message
of each field in front of the input field?
I haven''t been able to find anything similar on google. All I''ve found
is how to override the container around the input field.
ActionView::Base.field_error_proc = Proc.new { |html_tag, instance|
"<span
2011 Oct 26
6
Add an index to a form
Hello,
I''m having some trouble with forms, my app allows to enter data by
using a multi-step form that has 7 steps.
There are 3 steps that may let the user to add 1 form, for example
there''s a step called "children"
and that children has the following fields:
* name
* age
* gender
but one father may have more than 1 child and I''m adding another form
with
2006 Apr 25
2
Noob Question: Regarding Form
I''m hoping there''s an easy way to do this. I''m trying
to read options from a database, and insert them into form tags. So
for example,
In the Database Table: options
size: 300
type: text_field
maxsize: 300
and I want to create a text_field form tag, with all the appropriate
options, is there an easy way to do this, other than having the code
output the HTML
2006 May 18
3
populating array of text_fields from an array of model objects
I have in my view the following:
<% 0.upto(@num_performances) do |idx| -%>
<%= text_field ''performance'', ''city'', :index => idx, %>
<%= text_field ''performance'', ''venue'', :index => idx, %>
<% end -%>
and in my controller I have:
@performance = [Performance.new("city" =>