Displaying 20 results from an estimated 50000 matches similar to: "Production Questions"
2006 Aug 18
0
AJAX question
Dear all,
Help me get a simple AJAX behavior right. I know zero AJAX, thus
please advice. Below is a simplification of the real code and I hope
I can describe my intention clearly.
class StoreController < ApplicationController
def show_cart
@cart = Cart.new
@new_item = CartItem.new
end
def add_item
@new_item = CartItem.new(params[:new_item])
if
2006 Aug 18
0
Simple AJAX question
Dear all,
Help me get a simple AJAX behavior right. I know zero AJAX, thus
please advice. Below is a simplification of the real code and I hope I
can describe my intention clearly.
class StoreController < ApplicationController
def show_cart
@cart = Cart.new
@new_item = CartItem.new
end
def add_item
@new_item = CartItem.new(params[:new_item])
if @new_item.valid?
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
2007 Jan 20
1
Not appear error message
I have a partial form "empresa". In new.rhtml of "empresa", I call the
partial form of "usuario". Well, it is happening the following: When
save empresa, and stop in validates, as much in "empresa" how much
"usuario", appear only error message of "empresa", and not of "usuario".
Because this happening?
ps1.: I use flash_message
2006 Jul 27
0
Controllers, Models, and Validations...
Hello,
After listening to DHH''s 2006 RailsConf keynote, I decided to take a
leap on my current application and do a little more re-organizing to
make it more CRUD-based. As such, I ended up changing some things
around to get this (simplified):
User has_many :enrollments, :conditions => ''status > 0''
User has_many :schools, :through => :enrollments
User has_many
2006 Apr 19
1
AJAX - update item forms problem
I have a table showing some records from the database. These records
should be always ordered by some datetime field. The list of items is
changed by AJAX using RJS scripts and edits are done by showing and
hiding an update form under a chosen row. Adding and updating rows works
great but my problem is when the order of items is changed after making
some AJAX datetime updates update forms of
2010 Aug 25
0
[PATCH] Adding the VM Pool migration for vms
Signed-off-by: Simon COURTOIS <scourtois at linagora.com>
---
src/app/controllers/vm_controller.rb | 16 +++++++++++++
src/app/views/vm/edit_vmpool.rhtml | 39 ++++++++++++++++++++++++++++++++
src/app/views/vm/show.rhtml | 3 ++
src/public/images/icon_vmpool_11px.png | Bin 0 -> 542 bytes
4 files changed, 58 insertions(+), 0 deletions(-)
create mode 100644
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 Sep 01
1
[PATCH 1/3] Adding the VM Pool migration for vms
Signed-off-by: Simon COURTOIS <scourtois at linagora.com>
---
src/app/controllers/vm_controller.rb | 16 ++++++++++++++
src/app/views/vm/edit_vmpool.rhtml | 36 ++++++++++++++++++++++++++++++++
src/app/views/vm/show.rhtml | 3 ++
src/public/images/icon_vmpool_11px.png | Bin 0 -> 542 bytes
4 files changed, 55 insertions(+), 0 deletions(-)
create mode 100644
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
2005 Dec 25
2
[repost] newbie questions
Hi all,
I''m following the shop example in ''Agile Web Development with Rails''.
I would like to extend the checkout screen, in such a way people can change
the number of items they have selected in there cart.
In my controller I have:
def checkout
@cart = find_cart
@items = @cart.items
if @items.empty?
2010 Aug 26
1
[PATCH] Adding the ability to select a Host to start a VM
Signed-off-by: Simon COURTOIS <scourtois at linagora.com>
---
src/app/controllers/vm_controller.rb | 5 ++
src/app/models/vm_task.rb | 4 +-
src/app/views/vm/start.rhtml | 77 ++++++++++++++++++++++++++++++++++
src/task-omatic/taskomatic.rb | 7 +++-
4 files changed, 91 insertions(+), 2 deletions(-)
create mode 100644 src/app/views/vm/start.rhtml
diff
2006 Jun 07
0
problem with error_messages_for
Hi everyone,
I have this weird problem where error_messages_for isn''t working.
I have a model group which has to validates constraints..
---------------------------------
class Group < ActiveRecord::Base
#directionality points to the user model
#this table contains the foreign key
belongs_to :user
validates_uniqueness_of :name
validates_presence_of :name
end
2006 Apr 04
3
Forms, view & AJAX best practice help
What i''m trying to get working is I have a controller called
"permissions" and a view "permissions.rhtml". This view has a hidden div
that contains a form for adding new roles. Its just a single textfield.
Also on the page I have a dropdown list of roles and then underneath
that a div that contains a list of permissions for the role selected in
the dropdown. I
2006 May 03
0
Newbie Help
Is it my environment? Is something wrong, cause I thought this should
just work?
I have a simple table and I created a model and a controller:
ruby script/generate controller Restaurant
ruby script/generate model Restaurant
I edited the controller to this:
class RestaurantController < ApplicationController
scaffold :Restaurant
end
I run it and:
http://0.0.0.0:3000/Restaurant works
2006 May 24
0
Problems validating form with collection_select
I have the following models:
class Comandancia < ActiveRecord::Base
has_many :elementos
end
class Elemento < ActiveRecord::Base
belongs_to :comandancia
validates_presence_of :nombre, :apellido_paterno, :apellido_materno,
:comandancia
end
In the view for New Elemento I''m using
<%= start_form_tag :action => ''create'' %>
<%= render :partial =>
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
2006 Jun 21
2
error_messages_for not displaying validation errors
Hi all,
I''ve been searching the web and the list archives for help on this and I''ve
found some tips, but I''ve been racking my brain on this for hours.
I have a Model, View, and Controller that are handling the uploading of a
file to my server. I want to make sure that the description is set and that
a file is selected to be uploaded. I have set validates_presence_of
2006 Apr 11
0
Problem w/ error_messages_for: wrong number of arguments?
Hi guys,
I just upgraded to the latest version of Rails 1.1 and am getting some
odd error messages. Specifically, I have the line:
<%= error_messages_for ''user'' %>
at the top of one of my .rhtml files and of course a variable @user.
When an error occurs when saving ''user'', instead of getting the error
message (which happened fine in Rails 1.0), I now
2006 Jan 11
0
error_messages_for >> Cannot convert Array into String
Hi all
I have the following Model:
Member(id, username, first_name, last_name, hashed_password,
password_salt)
Now I want to allow users to register for an account using the following
form:
---
<%= form_tag %>
<%= error_messages_for ''member'' %>
<p><%= _(''Username'') %>: <%= text_field(''member'',