Displaying 20 results from an estimated 4000 matches similar to: "error_messages_for >> Cannot convert Array into String"
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
2010 Apr 26
2
woriking under webrick but not under passenger
Hi!
I have just added login feature to my rails application (followed the
instruction from (Agile Web Development with Rails) but now I am getting
strange errors (looks to me like some kind of routing problem) under the
passenger/apache.
The error is:
500 Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
From the log:
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
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 Jul 08
2
Creating/Saving dependent objects
Folks,
Am new to RoR and am building an example to get myself familiar. I am
running into a simple issue while creating a user registration page.
I have a User and Address models defined as below (partial/relevant code
included below). User has_one address and Address belongs_to user. I have a
foreign key defined in address table that refers to user(id)
In a form I take in username, password,
2010 Aug 09
0
Devise :current_password validations and checking (how???)
Hi Guys,
In my devise applications in Rails 3, I created a separate form under my
SettingsController class of which it handles the ''Change Password'' of
the User Model, so i can manipulate the current_user in the
SettingsController.
Now, I followed the set-up in the Devise/Views on how to update the form
using ''Change password'' and either way update User for
2008 Feb 14
4
How do I access this parameter?
Hi,
I have a form for creating users ...
<% form_tag ''userconfirm'' do -%>
<!-- more code -->
<p><label for="user_login">Username</label><br/>
<%= text_field ''user'', ''login'' %></p>
<p><label for="user_password">Password</label><br/>
<%=
2006 Jan 21
5
How do you deal with non-model property form values
I have a User ActiveRecord model that has email and password properties. I
want to build a login for that has a "remember me" option. My view looks
like this:
<% @page_title = "Login" -%>
<%= error_messages_for ''user'' %>
<%= form_tag %>
<table>
<tr>
<td align="right" width="1%"
2006 Jul 24
6
error_messages_for not working
I have the following code and I am not able to get it working. The error
message is not coming on the top, it is just getting displayed on a
different page if I dont have the rescue block commented at the bottom.
Model: user.rb
require "digest/sha1"
class User < ActiveRecord::Base
validates_presence_of :eaddress, :fname, :passwd, :pcode, :country,
:day, :year, :month, :gender,
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> <%=
2007 Jan 18
7
form_tag broken in Rails 1.2 RC2 or is it me?
I''m using Rails 1.2 RC2 and I''ve got a view that uses form_tag and the
form is not being rendered. It''s just not there. My view is this:
<div class="box">
<fieldset>
<legend>Log in</legend>
<% form_tag do %>
<div class="row">
<div class="formfield">
<label
2006 Jan 19
1
Model Validation & Floating Attributes
Hello all !
I have a model being validated that spits it''s error messages on the
resulting page using:
error_messages_for(:mymodel) .... Basic stuff. It''s working perfectly.
Now, I have something else I want to check on the same page (that isn''t an
attribute to the Model)... and am trying to add it using:
@mymodel.errors.add_to_base("another error here")
2010 Jan 26
2
accepts_nested_attributes_for :has_many :through => 'bug?'
Hey guys & ladies!
I''ve got the following relationship which i''m trying to get
accepts_nested_attributes to work with. But when i submit my form, it
looks as if its expecting a Company object, rather than an array of
companies. which really doesn''t make sense considering its a
has_many :relationship.
So what i''m after, is a way to
2008 Jun 30
1
Help with form_for
Hello, I had an app running on RoR 1.1, now I''m migrating it to 2.1.
In a view I have:
<div id="user_management">
<fieldset>
<legend>Please log in</legend>
<% form_for(:user, :url => sessions_path) do |f| %>
<p>Username: <span class="notice"><%= flash[:notice]%></
span></p>
2006 Jul 06
1
Form not inserting data into database
I have a form to register a user. The issue I am having is the fact that
it only populates login, hashed_password and created_at fields.
DB table:
create table users (
id int not null auto_increment,
login varchar(100) default null,
hashed_password char(40) default null,
email varchar(255) default null,
salt varchar(255) default
2007 Oct 23
11
validates_confirmation_of not working?
I just can''t get validates_confirmation_of working for the life of
me!...
It''s not the first time I''m having problems with it but I just never
understand why!... This time I pretty much followed *exactly* the
example in Agile Rails Development and still...it just won''t work! I put
2 different passwords in the form and it doesn''t trigger an error,
2008 Dec 05
4
Replicating Form Behaviour in Functional Test
Hi,
I''m really struggling getting a controller test to pass while the form
that uses the method operates correctly.
I would really welcome a second pair of eyes to help me find out what
I''m missing.
The test
def test_set_password
@request.session[:user] = users(:admin)
put :set_password, :id => users(:one).id, :user => {:password =>
"newpass",
2006 Jan 24
3
AJAX Preview & Edit Page Problem
I''m new to RoR and have started building my first application.
I''m building an account sign-up controller and I have two questions:
1. What is the best way to pass form params between methods in my
sign-up controller? The solution I''m using seems too hacky and there''s
got to be a something more elegant. I''m instantiating User.new to
capture the
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