Displaying 20 results from an estimated 10000 matches similar to: "created scaffold, failing when creating new?"
2006 Apr 18
1
''wrong number of arguments'' for text_field?
This is probably something very simple but I can''t seem to figure out
why I keep getting the ''wrong number of arguments (1 for 2)'' error with
the following code when I try to create a new record. If anyone can see
what is going wrong here please help!
new.rhtml
-------------------------------------------------
...
<%= start_form_tag :action =>
2009 May 22
1
rails 2.3.2, active scaffold, nested, ActionView::TemplateError (undefined method `format_column' for #<ActionView::Base:
Before I dig in any further (since I have no idea where to go from
here...)
Has anyone been succcessful with 2.3.2, AS, and nested scaffolds?
I have the latest of AS and the render_component plugin via
% script/plugin install --force git://github.com/lackac/render_component.git
-r rails-edge
I have an AS user_controller:
active_scaffold :user do |config|
...
2007 Nov 06
2
Why is this view spec failing?
I can''t figure out why I am getting a failure. It renders out fine in
the browser.
<h1>New member</h1>
<%= error_messages_for :member %>
<% form_for(:member, :url => members_path) do |f| %>
<fieldset>
<legend>Member Info</legend>
<p><label for="member[first_name]">First Name:</label> <%=
2010 Aug 03
2
Strange error message when rendering the scaffold form
Hello everyone, I am developing my application and I created a
scaffold called listas, but when I acess /listas/new I get this error
message:
NoMethodError in Listas#new
Showing /home/rodrigo3n/code/listeiroo/app/views/listas/_form.html.erb
where line #15 raised:
undefined method `deep_symbolize_keys'' for nil:NilClass
Extracted source (around line #15):
12: <% end %>
13:
14:
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 Jan 10
0
Changing scaffold''s text_field to a password_field causes white screen of death in mozilla?
I had posted earlier about ''silent failure of a controller'', what seemed to
be an intractable problem where I was getting failure of a particular action
in a controller while others worked. What was irritating was that there were
no useful messages. Nothing to the browser, nothing in logs, and even the
breakpoints wouldn''t hit. Finally by a process of elemination I found
2006 May 11
1
RoR completely ignoring a column when saving changes
I have an action that needs to update two models/two tables in one shot,
and it works great, but ignores one column. Here is the action code:
(verify_id is irrelevant in this case)
[CODE]
def edit
@page_title = "Edit User"
@page_active_3 = "active"
if request.post?
@user = User.find(params[:id])
@profile = @user.profile
verify_id(@user.id,
2005 Dec 29
2
validation highlighting on non-scaffold fields
Hi all,
I''m new to rails.
I have created a bunch of CRUD code using scaffolds.
I had to add code to the default output to account for
fields that establish the relationships between tables.
Everything works well, including the validation of the
fields I added. However, I can''t get the highlighting
to work for my fields when they fail validation and the
view is redisplayed.
2008 Jan 25
1
form error with datetime select
Hi, Im trying to build a form using:
<% facebook_form_for(:task, at task,:url => create_task_path) do |f| %>
Assign Task To: <%= fb_friend_selector %>
<%=f.text_field :ttype, :label=> "Title"%>
<%=f.datetime_select :duedate, :label=> "Due Date"%>
<%=f.buttons "Add" %>
<% end %>
But im getting an
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 Jun 19
3
Parent Child form using Partials
I am trying to make a simple application which consists of contacts and
their addresses.
class Contact < ActiveRecord::Base
has_many :addresses
end
class Address < ActiveRecord::Base
belongs_to :contact
end
I would like to be able to edit/add addresses from within the edit/add
of the contact. I scaffolded the contact and address objects and
modified the contacts/_form partial as
2006 Nov 04
0
Having problems with edge rails
I just switched to Edge Rails (revision 5207) since I want to use the
BigDecimal support for an e-commerce website.. Unfortunately, some of
my old code seems to be breaking things..
First off, it looks like my "skip_before_filter :check_authentication,
:check_authorization, :only => [:login, :forgot_password]" doesn''t
work at all, since the before_filter gets executed for
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 Feb 17
3
"URL" model not possible?
Hello there,
I just added an URL model to my app (allowing users to basically add
urls etc), which works perfectly fine on the console, but the views
are not working properly. I always get the following error (e.g. when
wanting to create/add a new url):
ActionView::TemplateError (undefined method `rewrite'' for #<Url:
0x25a6070>) on line #5 of urls/new.html.erb:
2:
3: <%=
2006 Aug 06
1
creating hash table, how do i? please help
hi, i have a noob question. how do i create a table but add additional
fields? for example..
i have a total_table of total, county, and town where total_table
inherites county_id and town_id from my town_county table where
county_id has_many towns. in my view, id like to go through the hash
like this
table total_table
for total_table.county
{
print total_table.county
print
2006 Aug 12
10
adding extra variable to a class, how to access it?
somple question here but pretty confusing on my side. i have a model
towns that is mapped to my towns table. can i add an extra variable to
the class and access it in my view? basicall what i am trying to do is
return a list of towns, and next to each town, display a total number of
what i have in each town.
ive tried both attr_reader and @total but no avail.
here is my view
<% for
2006 Sep 06
1
Changing Scaffold
Hi,
I am starting a project in rails and I wish to change scaffolding.
I''ve already done some changes like prepare all texts for locale. Now
I am wishing to change the way it generates the _form partial. Could
someone give some guideline so I can study such thing?
I saw "template_for_inclusion" in form.rhtml but couldn''t find out
how to change it.
Being more
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 Feb 03
3
My associations are coming out nil.
I''ve got a fairly simple system with a table for my Users that
includes a CountryId field which looks up to the CountryId field of my
Country table. What I would like to happen is for my Rails
application, which contains models for both User and Country, to be
able to draw the dropdown list of available countries on the edit
page, like it does in all the tutorials.
My model classes look
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