Displaying 20 results from an estimated 4000 matches similar to: "Creating a child simultaneously with parent via form"
2005 Sep 02
7
Form to update two tables
Hello there,
this is probably a very simple problem but I''m stuck.
I''m following the Login generator tutorial from rubyonrails. It''s all
worked fine so far. But I want to add a bit more functionality so that
when a user signs up in addition to chosing a login name and password
they type in a company name which is added to a seperate table called
COMPANIES. The id
2010 Dec 21
5
Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id
Hey all,
I know that this:
Called id for nil, which would mistakenly be 4 -- if you really wanted
the id of nil, use object_id
means that I have an instance variable that has not been initialized.
However, I''m a little confused as to what to do in a signup form for
form_for:
<% content_for :login do %>
<% form_for @user, :url => { :action => "login" } do
2005 Aug 07
8
Ajax forms and redirects
Here is an example that seems perfect for Ajax that I have not seen
implemented nor can figure out how to do it. I am hoping someone can
give me some pointers.
On the sign-up page, I would like to do my validations (password
length, username uniqueness,etc ) Ajax-style. But if all validates,
then redirect to the success page. The combining of redirection to a
new page with Ajax is throwing me.
2009 Dec 23
8
Where did this value in a form come from?
Newb here.
I have a form and a value that is being displayed ... and I have no idea
where the value came from.
I have done a
<%= debugger; '''' %>
in the form and, indeed, the debugger stops at the statement.
I have tried to trace through the code to see where the value came from
... and I gave up.
So ... what in Rails initializes the fields of a form?
--
Posted via
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 Jun 12
2
Validating a non-object attribute in a form via checkbox?
Hi there
A user can place an ad with various attributes via a form; however, I
want the user to check a box signifying that they''ve read the terms
and conditions for use of the site.
So the ''terms'' is not an attribute of the Advertisement model. I
could check that the user has ticked the box in my controller but
would like to bundle this up with the validation
2006 Nov 04
0
Functional test issue for testing newbie
Hi there
I''m having difficulty succesfully updating attributes via a post
request in a functional test.
Here''s some pastes:
######################################
# account_controller.rb
def edit_details
@user = User.find(self.current_user.id)
return unless request.post?
if @user.update_attributes(params[:user])
flash[:notice_good] = ''Your account details
2006 Jul 25
5
webrick server slow or does not connect
hi,
In login_controller.rb when I do the fallowing code it works fine
before_filter :authorize, :except => :login
but I want to do the fallowing when creating the user so the
authorization is not checked
before_filter :authorize, :except => :login, :except => :create_user
but when I do this webrick server appear to be slow or not connected and
take lot of time to load?
Could someone
2008 Mar 17
4
RSpec''ing model association callbacks
Hi all,
i''m learning rspec and i must admit i really love it.
But at the time i started learning it, i already
developed my models classes and their callbacks.
Now i''m trying to get a 100% coverage of my code but i
cannot reach it because i do not understand how to
spec my callbacks.
Look at this for example:
----------------- User Model
class User < ActiveRecord::Base
2007 Sep 23
4
Story Runner, autoincrementing
I''ve written a story and I run into a snag.
I''ve written the create_forum method and told it to set the id to 1
but when it creates the forum the id is autoincremented.
My forums table is empty but the id keeps incrementing the newest record on
creation.
When I run the story it comes out as something like 59 which fails my story
because I''m asking it to look at /forums/1
2006 Aug 06
2
assert_difference gives undefined method error in unit tests
Hi there
Am hitting undefined method errors for ''assert_difference'' in my unit
tests under Rails 1.1.4
What could I be missing?
Richard Sandilands
2006 Jul 25
2
Shovel/TextDrive error: missing SSHAgent.socket
Hi there
When running the initial ''rake remote:exec ACTION=setup_lighty''
command I get this error:
''No such file or directory - /tmp/501/nl.uu.phil.SSHAgent.socket''
Any clues would be appreciated.
Richard Sandilands
2007 Oct 02
2
Requires from other modules / requires with aliases
Hi everyone, I''ve been working on a module for bacula, and I''m having
a problem requiring resources I''ve defined in other modules. At the
moment, I have the following (simplified):
/etc/puppet/modules/bacula/manifests/init.pp:
class bacula {
...
define configure ( $gui="true", $db_password ) {
...
postgresql::create_db {
2007 Dec 11
3
Transactional/Rollback problems
I''m having a rollback problem with rspec trunk. It doesn''t seem like
rollbacks are happening quite as often as they should be. It
appears as though the rollbacks are *NOT* occurring on the first
description block in a file, but are for the rest. Here is a set of
specs that are failing:
require File.dirname(__FILE__) + "/../spec_helper"
describe
2006 Aug 02
3
Data relationships for e-commerce: users, orders, addresses
Hi there
I''m in the process of developing an e-commerce Rails app but am
getting a little stuck on what models I should be working with on the
order/checkout side of things.
The app requires users to be registered and authenticated to checkout.
So I already have a User model and an Order model (which belongs to a
User). The Order model is largely similar to that used in the Agile
Rails
2006 Feb 09
4
Login_Engine: trouble configuring
Hi Guys,
I''m having some trouble getting login_engine to work. I''ve followed the
steps in the README file to the letter (I think) with the exception of
the Mailer stuff and cannot get my application to run. Heres what I have;
module ApplicationHelper
include login_engine
end
#####################################
require ''login_engine''
class
2007 Oct 16
10
Scenarios Plugin Pre-Announcement
This is sort of a pre-announcement for a Rails plugin my friend Adam
Williams and I are working on. We''re in the process of extracting it
from a project we are working on so that it can be generally useful to
the Rails community. We are calling it "Scenarios". It is a drop in
replacement for Rails fixtures:
http://faithfulcode.rubyforge.org/svn/plugins/trunk/scenarios/README
2007 Nov 20
9
Testing Models without fixtures
Hi,
I would like to test a sorting method that is in the user model, it''s
a class method called search.
What I would like to do is create 2 users and load the test database
with just those 2 users, so that I can call
User.search("john") and it would return those two users.
Not sure how to clear the test database and populate it just with
these 2 users for that specific
2010 Feb 23
12
"no such file to load -- gettext/rails" error
I get the error below when I try to start my server.
Here are the versions installed:
OS: Windows Server 2008
Ruby: 1.8.7
Gems:
actionmailer (2.3.5, 1.3.5)
actionpack (2.3.5, 1.13.5)
actionwebservice (1.2.5)
activerecord (2.3.5, 1.15.5)
activeresource (2.3.5)
activesupport (2.3.5, 1.4.4)
cgi_multipart_eof_fix (2.5.0)
daemons (1.0.10)
gem_plugin
2008 Nov 15
4
data not being saved
I am trying to save data entered in a form and nothing seems to be
saving. What do you I have to look at to ensure everything is set-up
correctly? I have looked in my database.yml file and all looks good and
the database that I am trying to use exist. Thanks,
-S
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you