Displaying 20 results from an estimated 10000 matches similar to: "New field does now show in browser"
2006 Feb 21
2
ActiveRecord before_ callbacks question
Hi!
I need to set the primary key in a model and postgres table to something
different than id. View Edit and such works in the scaffolded
controller. However if I click in the controller below the list of data
onto New then I get an error message like this:
Showing app/views/admin/_form.rhtml where line #5 raised:
undefined method `nr_before_type_cast'' for
2006 Jan 13
5
Form field naming semantics question
Hi,
I have a question today regarding how the various form elements in
_form.rhtml are named.
I understand that for a database table "persons" with a column headed by
"name", then in _form.rhtml it will probably be like:
<p><label for="person_name">Name><br/>
<%= text_field ''person'', ''name''
2011 Mar 08
2
Comment creer un formulaire maitre-detail
Salut a tous!
Est-il possible de creer un formulaire maitre-detail?
J''ai besoin de creer une fenetre ou l''utilisateur rentre un commande et
les differents produits associaes a cette commande.
Puis-je afficher le tout dans une seule page? Faut-il un minimum de 2
pages
Comment visualiser le detail de la commande avec tous les produits
commandes, et l''imprimer si
2006 Nov 28
2
Twice the same code, but only once it seems to work
Hello,
I am confronted with a very strange problem which I can not solve... and
God I tried a lot, lost almost a whole day, but couldn''t find an answer:
The idea is to have a form both in admin and in dir, in admin there will
be some more fields that is why I have twice a form. In admin the form
appears, in dir the form does not appear instead
"þÿ
New company" why is it that the
2006 May 04
1
Instance or local vars for field helpers in partial template
I''m getting confused.
If I have a view (.rhtml), I can use a field helper like:
<%= text_field :mymodel, :attribute %>
This uses the value from @mymodel.attribute
Now, if I am rendering a template normally (i.e. not partial), I would
expect @mymodel to be a model object defined as an instance variable in
the controller.
However, if I am rendering a partial template, I
2006 Jul 31
4
Login Password text field values
I have a text field that I use for logging in users. Due to the design
of my site, I don''t have room to put the word "username" in front of the
text field so I''d like to actually display it inside the field and then
have the word clear when the user clicks on it.
How could I modify something like this
<%= text_field "user", "login", :size
2010 Jul 21
4
Association record duplication
I have an edit page that generates a few input fields I organized in a
table, like so:
<tr>
<td>Driver License</td>
<td>
<input
id="person_accounts_attributes_0_account_documents_attributes_1_number"
name="person[accounts_attributes][0][account_documents_attributes][1]
[number]" type="text" />
2006 Apr 29
1
can i alter the _form.rhtml without have troubles to validat
hello my name is reynaldo
and i have a problem
i alter the _form.rhtml to display a select option in the place a simple
text_box, and the application work very well, but in the moment that i
apply a validation in the model i get a error.
the code is the next
in the controller:
def new
@catelemento = Catelemento.new
@komandancias = Catcomandancia.find(:all)
end
in the
2007 Sep 30
2
Outputing to the browser, how?
Hello,
I''m writting some helper methods to write forms, so I have this working code:
class TableFormBuilder < ActionView::Helpers::FormBuilder
["file_field", "password_field", "text_field"].each do |name|
define_method(name) do |label, *args|
@template.content_tag(:tr,
@template.content_tag(:td,
@template.content_tag(:label,
2007 Nov 20
3
How to test views with Nested Resources and Partials
Hi everyone,
I am relatively new to rspec and I am running into a wall in testing my
views. I have a RESTful resource Contracts with a nested resource of
Line_items.
I am trying to figure out how to test the "edit" form of the Line_items.
What complicates this is the nested routing and how to account for it,
and that there is a partial form (_form.haml) that both the edit.haml
and
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/>
<%=
2009 Feb 06
2
Using partials with form_for
hi all
i was wondering whether it is possible to use partials along with form_for
and form_field. following code is not working. is there some error or this
case is impossible..??
*#new.html.erb*
<h1>Enter Details for new Partner:</h1>
<% form_for(@partner) do |f| %>
<%= render :partial => ''form'', :locals => {:partner => f} %>
<p>
2006 Jul 06
1
Problem implementing password and password confirmation
Hi,
I''m trying to implement password confirmation, based on the Agile
example, but just can''t make any progress.
User DB has these fields:
=========================
t.column :name, :string, :limit => 40
t.column :hashed_password, :string
t.column :salt, :string
User model has:
===============
attr_accessor :password_confirmation
2010 Nov 28
6
has_one accepts_nested_attributes_for fields_for NOT WORKING HELP
MODEL
class User < ActiveRecord::Base
has_one :address, :dependent => :destroy
accepts_nested_attributes_for :address
end
CONTROL
def new
@user = User.new
@user.build_address # Adicionei
...
VIEW partial _form
....
<% f.fields_for :address do |b| %> # Adicionei
<%= b.text_field :city_manual %> # Adicionei
<% end %>
2006 May 31
7
How do you create a controller & view to create a list of objects?
I''m trying to figure out how to design a view and controller to work with a
simple collection. I have a Foo that has many Bars, so here''s what I did:
$ ruby script/generate model Foo
$ ruby script/generate model Bar
(Uncomment t.column, :name: :string in foo and bar migrations)
(Edit Foo.rb and Bar.rb, add has_many :bars to Foo, belongs_to :foo to Bar)
$ rake db:migrate
$ ruby
2006 Mar 01
1
observe_field question
I''m sure this is a simple problem, but I''ve been working on it for a
couple days and can''t seem to figure out the correct way to structure my
observe_field call. The HTML and Javascript generated all appear
correct, but the AJAX call is never made. Below is the code I''m using
and any help would be much appreciated.
models_controller.rb
def
2008 Oct 11
1
http://localhost:3000/index.html does not open my home page
Hi all
How can I change the setup in order to open my home page "index.html"
located inside the Public folder when I type
http://localhost:3000/index.html
thanks
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to
2006 May 22
2
Inserting data in a table with a varchar key field
Hi all,
I have some problems inserting data into a legacy table. the key field
of this table is a field named CIN which is a varchar(15).
when I try insert into this table using a form (generated by the
scaffold generator) I get this Error :
_____________________________________________________________________
undefined method `CIN_before_type_cast'' for #<Candidat:0x370d8c8> |
2011 Jul 25
4
[Rails 3.0.9] I have trouble about fields_for
Hi,all. I''m new bee to Rails and I have trouble about fields_for
method..
It isn''t show up between the <%= f.fields ~ <% end %>
Please teach me some advice.
Thanks!
#new/_form.html.erb
<%= form_for(@user) do |f| %>
<div class="field">
<%= f.label :name %><br />
<%= f.text_field :name %>
</div>
<!-- Below
2005 Jul 06
2
Composite Views
Hello:
How do you create a composite view? I have a form based on the model
"contacts" which consists the following models:
- organization
- person
- address
I was going to use partials to create the form; e.g:
- organizations/_form.rhtml
- people/_form.rhtml .etc
...and render them with the appropriate tag:
<%= render_partial ''people/form'', @person %>
I