Displaying 20 results from an estimated 4000 matches similar to: "Pass paramter via form"
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 30
7
text_area
How to make that the typed code on ruby in text_area it was carried out
in @params ["name"]??
--
Posted via http://www.ruby-forum.com/.
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
2006 Apr 05
1
FormTagHelper form names: possible?
Thank you to everybody that has helped me since I signed up. I''m flying
along thanks to you.
I have a question about the FormTagHelper "start_form_tag": I''ve been
trying to figure out how to get Rails to output a "name" attribute for
my form so I can hook in a Javascript to focus on a field inside of it
on load, but it doesn''t look like I can do
2006 Jun 30
4
Serious noob question. Any help would be great
Hi All,
I''m working on building an app that can log and edit phone call
information. I''ve got the creating and editing parting working great,
and I''ve started an attempt to add searching. I can''t seem to figure
out how to get an [:id] parameter from a form and passed between two
controller methods. Right now I have a web page with a single text
field in it
2006 Feb 07
3
Newbie help ..
Hi ..
I am new to Rails and it is not clear to me why I am getting the
following error. Any help appreciated.
-m.
$cat app/views/admin/new.rhtml
<% @page_title = "New member..." -%>
<%= start_form_tag( :action => ''create'' ) %>
<table>
<tr>
<td> First Name: </td>
<td> <%= text_field(
2006 Jul 08
4
Hidden fields in forms
Please can someone show me the correct syntax for a hidden field in
forms, this is my code
<%= start_form_tag :action => ''create'' %>
<div class="form1">
<table width="auto" boader="8" cellspacing="5" cellpadding="5">
<% hidden_field ''line_item'', ''client_id'', :value
2006 Jun 20
2
Validation error_messages_for problem
I am having trouble getting error_messages_for to work.
My controller(relevant parts) looks like
def configure
@account = session[:account]
@user = User.new
end
def add_new_user_to_account
@user = User.new(params[:user])
if @user.valid?
session[:account].users << @user
end
redirect_to :action=> ''configure''
end
end
and my
2008 Apr 14
9
scientific notation problem
We''re developing a system that''s used for tracking company IPO data
and we''re running into a few number storage issues. For large numbers,
i.e. numbers greater than 100 million, MySQL insists on storing these
as scientific notation. I don''t really have a problem with that but
when we want to edit these fields using something like:
<% form_for(@company) do
2006 May 18
2
attempt to override the ''tag'' method
I want to override the ''tag'' method in
ActionView::Helpers::TagHelper to do some generalized
error handling similar to the way scaffolding puts a
red border around fields that fail validation.
I''ve created a file lib/rails_patches/tag_helper.rb
which contains the following.
module ActionView
module Helpers
module TagHelper
alias_method :orig_tag, :tag
2006 Feb 03
9
Because I''m very slow - trying to use console
I can''t see how to use variables so I am using console to test things
out...
clients table - a column named first_name
My very brief console session...
>> clients = Client.find_by_sql("select * from clients where first_name
= FN")
ActiveRecord::StatementInvalid: RuntimeError: ERROR C42703 Mcolumn
"fn" does not exist Fparse_expr.c L1034
2006 Apr 16
5
render :collection and default value
Hi all,
I am having a lot of trouble to get the default value of text fields
when they are generated by a partial from a collection.
I have been on this for a whole week and I didnt find a single exemple
on the internet of someone using a partial that generate text field with
a default value.
I cant believe that I am the only one having this problem. Anyone has an
exemple they can show me?
2006 Apr 14
3
Updateform with a has_many relationship ?
Hello all,
I would like to be able to update the "amount" of a certain item in
me order list.
The problem I run into is how to define the text_field element.
@order is the current order, which has_many :order_item which in turn
belongs_to :order.
order_item has a field "amount" which should be modified...
What I tried is this below, but I get a undefined method
2006 Mar 18
2
Need help with my view populating rows
Hello, I was talking with someone in IRC, trying to get one form with
however many fields to make new rows. He worked with me on the controller,
but then I didn''t get the help with the view I needed, and I''ve been trying
to do it on my own.
I''m uploading pictures to my Pictures table. As you know, I need a few
fields for each picture. I''ll need the filename,
2006 Aug 07
8
Login form question
I''m using Rails Recipes to create a login form but instead of username
and password, my setup is firstname, lastname, password.
I seemed to be gramatically challenged and not sure how to set up the
parameter list. Can anyone offer up a suggestion.
The book shows the method starting like:
if request.post?
user = User.find(:first, :conditions => [''username = ?'' ,
2006 May 14
3
need help for simple form tag (noob)
when the user click on "Search" I would like it to point to
http://curentpage/?filter=searchtext (the filtering code is already
written)
it would look like this:
<%= start_form_tag(url_for_options = {<something>}) %>
<%=text_field (<my_filter>) %>
<%= submit_tag(value = "Search")%>
any idea how to do this?
thanx in advance
2006 Apr 24
3
Form with multiple rows of content
I have looked at examples for this. I found a similar example in the
Agile Web Dev... book but that didn''t help. Here''s what i am trying to
do.
A Cart has many line items. On the Display Cart page, I want to provide
the user the option to update quantities.
Here''s the rhtml code:
<%= start_form_tag :action => ''update_cart'' %>
2006 Aug 06
6
View passing empty or no value to controller -- help
Hi,
I have the following view:
<%= start_form_tag ( { :action => ''find'' }, :method => ''get'') %>
<p>
<%= text_field_tag :lemma, params[:lemma] %>
</p>
<%= link_to "Find It", :class => "submit" %>
<%= end_form_tag %>
And the following find action in the controller:
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 May 09
3
validations erasing the form
Hi there
I have a for with a couple of text_fields. I''m doing some validation
via the model and when the validation "works" I get there was an error
on blah blah
the problem is the form is erased and I have to fill up the form again!
I saw that scaffold keeps the form filled when the validation "works"
but I dont know exactly what''s making it happen!
I would