Displaying 20 results from an estimated 10000 matches similar to: "Collecting data from forms"
2006 Aug 02
7
form_for not working with Markaby
I''m playing around with Markaby and I decided to write a little blog app.
I''m running into issues with forms however. If I use form_for the output of
the form gets swallowed. For example:
form_for :article, @article do |f|
f.text_field :title
f.check_box :published
f.text_area :description
f.text_field :pub_date
f.text_area :content
end
gets rendered as an empty form
2006 Jan 20
1
form_tag and multiple buttons inside problem
Hi, I have a bit of a problem with a form in rails. Well, the problem really is
me not fully understanding the mechanism of the form_tag, so here''s what i try
to do:
The idea is to present a some edit fields for some @product attributes and then
present a table showing the @product.pieces (pieces for every @product) and to
include a "Edit Piece" and "Delete Piece"
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
2013 Dec 10
2
form_tag + fields_for Rails 4
Hi There,
I''m trying to user fields_for inside a form_tag, but i can''t catch it
on my controller.
I just take some html code off to makes it easy to read
my view...
i''m using campuses_path(current_church, @campus) instead form_for
@campus, because my route is like
resources :campuses, :path => ":church/campuses"
<%= form_tag
2006 Mar 14
7
Single form w/ relationships: how do I integrate it?
OK - I know this has been asked before, but I cannot find it in the
archives. Forgive me if I''m creating more noise than I should.
I want to know the easiest way to deal with this scenario:
I have articles. I have categories for the articles.
On the form where you write an article, there needs to be a free-form
field to entire the category.
The create() method will build the
2005 Dec 19
7
Error handling!
Hello all,
I''m in the beginning states of learning ruby on rails development and
have got to a part where I''m a little stuck! Basically writing a simple
blog application, just to try something completely different! ;-)
I have a page which displays the current blog entry, it''s comments and
at the bottom of the page, a form to add a comment. So far, so good.
2008 Jul 02
3
attachment in mail
How to do the attachment in mail like the yahoo and gmail does?
--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
2006 Jan 05
2
help - edit without using scaffold
Hello,
What am I doing wrong? The code below does not show the current record for editing.
def edit
@user = User.find(params[:id])
end
def update
@user = User.find(params[:id])
if @user.update_attributes(params[:user])
flash[:notice] = ''User was successfully updated.''
redirect_to :action => ''show'', :id => @user
else
render :action
2006 May 09
2
User.new doesn´t capture all of the parameters
Hi,
I have a page where I can add new users to the database, but it only
sees whats in the name and passord field.
add_user.rhtml:
<%= form_tag %>
<%= form_tag :action => ''add_user'' %>
<td>User name:</td>
<td><%= text_field("user", "name") %></td>
</tr>
<tr>
<td>Password:</td>
2006 Apr 06
3
Inserting parent_id
I have two tables:
- projects
- lines
lines has a foreign key constraint to projects.id
When I''m creating a new line object, the database fails on insert with
the following error:
"PGError: ERROR: null value in column "project_id" violates not-null
constraint"
My code looks like this:
def create_lines
@project = params[:id]
@line =
2006 Jul 27
2
setting initial text field values in a form
Hi,
I am trying to create a basic form in which I want one of the fields
initialized before displaying it.
My code (in a view) is as follows:
<%
if ( session[:user_id] != nil )
then
logged_in_user = User.find(session[:user_id])
end
%>
<% form_for :suggestion do |form| %>
<label for="suggestion_title">Topic:</label><br/>
<%=
2006 Jul 17
2
error_messages_for ?
Hi,
I can''t list error_messages in my Form ??, and all the formfields are
reset ...(I think my redirect :back clean everything, formfield and
error_messages ...), only my flash[:notice] is ok....
I would like to use the "error_messages_for" tag to add a simple red *
on my textfiled if a problem occurs ...
thanks for help
arnaud
here are the basics steps to check that
2006 Jul 21
1
Passing a variable between methods
Hi,
I am trying to add search functionality to may application. I am
struggeling to pass my query to the controller and then show all my
search results in another view. How would I do this?
Model:
class Advert < ActiveRecord::Base
belongs_to :user
def self.search(query)
if !query.to_s.strip.empty?
tokens = query.split.collect {|c| "%#{c.downcase}%"}
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
2005 Dec 16
6
managing belongs_to fields in a form
Hi all,
I cannot find a clean way to create/edit an object that ''belongs_to''
another one, just by using form fields.
I always need to explicitely unassemble it, store the master id in a
hidden field, and then refetch the master from its id, and put it back
in the object.
To summarize:
I want to create a new member, for a given project
@project= ...
@member =
2009 Oct 22
19
undefined method `stringify_keys!' for "":String
i have an error
undefined method `stringify_keys!'' for "":String
my view is given below
<%= form_tag :action => ''resolve_create'', :resolve => @resolve %>
<p>resolution:<br />
<%= text_area ''resolve'',''content'', :cols => 40, :rows => 12 %></p>
<%= submit_tag
2009 Jan 08
4
Problem with disable_with
Hi Group,
I have a registration.html.erb page with the following JavaScript at
the top which I use to validate form fields:
<script type="text/javascript">
<!--
function validate(){
if ((document.myForm.email_projectname.value=="")||
(document.myForm.email_projecttype_id.selectedIndex<1)||
(document.myForm.email_region_id.selectedIndex<1))
{
alert
2009 Nov 26
9
ActionView::TemplateError (can't convert ActiveRecord::Error into String)
I cannot work out why this error is appearing.
ActionView::TemplateError (can''t convert ActiveRecord::Error into
String) on line #3 of app/views/button/_show_enquiry.html.erb:
1: <h1>Send us a message</h1>
2: <% remote_form_for :enquiry, :url => {:action => ''send_mail''} do |
f| %>
3: <%= error_messages_for ''enquiry'',
2008 Jul 14
5
How can i use link_to_remote with in form_for
Hi
anybody plz help me how can i use link_to_remote with in form_for.. i
tried but no luck... if i use form_tag i can able to use link_to_remote
and made ajax call.but i need to use form_for ....can anyone help me how
can i do with this.Thanks in advance.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are
2009 Jul 29
6
Doubt in nil object with ajax
hi this is my htnl
<html>
<head>
<%= javascript_include_tag :defaults %>
</head>
<body>
<%= form_tag nil, { :id => ''search_form'' } %>
<%= text_field ''recipe'', ''name'' %>
<%= end_form_tag %>
<div id="recipe">
</div>
<%= observe_form :search_form, :frequency =>