similar to: Best Idiom for form using multiple models

Displaying 20 results from an estimated 10000 matches similar to: "Best Idiom for form using multiple models"

2006 Mar 23
4
RJS and Form Validation (Best Practice)
Hello All ! I''ve been using RJS extensively, but haven''t done any form validation with it until now. Should I be manually passing the RJS template some models error messages from the controller.... or ... should I be using error_messages_for in order to do the display ? I''ve implemented the first approach, but it seems like quite a hack. Any insight would be greatly
2006 Apr 09
12
Validating two models from one form
Howdy, I''m working on my first RoR project, and I want to build a form. The tricky thing is, this form needs to insert / update against two models, each with their own validation rules. Unfortunately, I''m having an incredible amount of difficulty with the error handling, specifically the fields wrapped in <div class=''fieldWithErrors''></div>
2006 Jul 08
1
Ajax, RJS, and Standard Form Errors
Hi all, I''m trying to take the standard scaffold and add a bit for ajax to it. I have a two column page with the list on the left and the right side is reserved for the create/edit actions. On a successful save my rjs executes and updates the list view on the left and returns the right side to a "home" page. However, if one of the model validations fail I use rjs ro
2006 Jan 04
2
how to display validation error messages for multiple record form
I am trying to figure out how to display model validation error messages for a multiple record form. My form is for setting up new accounts and collects information for two models - Accounts and Users. My create method collects the parameters from the form and adds them to a Account object and a User object then runs account.valid? and user.valid?. If it''s valid it updates the models
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 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 Feb 15
6
error_messages_for trouble
I am trying so learn how to do custom validations. The validation works as expected, but I can''t get "error_messages_for" to display. How is the name of the object supposed to be formated? Where is this object created, the model or controller? What am I doing wrong here? #### Model ######################## class MyFolder < ActiveRecord::Base def validate # validation
2010 May 21
0
Multiple Models one form and validations ... no transactions(mongo)
I am trying to setup a sigup form thats pretty much just like the basecamp form. https://signup.37signals.com/basecamp/Plus/signup/new I want to create a User a Studio and a Subscription(chargify) a Subscription belongs to a Studio and not to a User. User gets tagged onto a Studio via an admin array. Is there any way to do this all in one form and still get back validation errors etc without
2006 Jan 15
4
form inputs resetting on sumbit
I searched for forum for something about this but couldn''t find anything. For example I have this in my view: (you enter start/end dates from dropdowns, pick a category and a report is generated.) <%= start_form_tag :action => ''display_report'' %> From: <%= date_select ''report'', ''date1'' %> <br /> To: <%=
2006 Mar 02
1
Forms with and without Models and Error Handling
Hi, I currently programming a delicious clone to understand ruby on rails. The problem I''ve got is that I prefill a form (form without models) without a database connection and then save it into the database. For validation i am using the validation helper methods. My Problem is that i don''t know how I get the error hash from the helper method validates... etc. because I
2006 Feb 21
2
validations and directing errors
I am starting to play with validations as I want to catch errors before SQL rejects inserts to the table which are ugly when nulls are sent to ''Not Null'' columns, etc. If I do something in my model like... validates_format_of :first_name, :with => /^\w+$/, :message => "you moron, enter a name" I still end up
2008 Mar 08
9
Validation error handling on related models
I have 2 models, entity and client. Entity has_one client and client belongs_to entity. Entity has attributes name and legal_name. Entity also has an unique index on (lower(name)). The pKey for both is the conventional Rails id. Client has a fKey constraint on entity_id and is indexed in entity_id. In controllers/clients_controller.rb I have: # GET /clients/new # GET /clients/new.xml
2006 Aug 08
4
Creating a child simultaneously with parent via form
Hi there I''ve got a user model and an address model; a user has_many addresses. A user object can be created via an html form which also allows for an initial address to be created. I''ve got a controller method working to save both objects via the form, but I suspect I can achieve this in a more rails-esque manner. Here is my controller method: def signup @user =
2006 Aug 16
6
Create several models at once and validating
I have two models User and Team. Also I have a register form where the new user fill in her data and choose a name for a Team. Well, in the user model there are several validations which work fine, but team model also have a validation for a uniqueness name that doesn''t fire up when she gives an existent team''s name. This is the flow it follows: /user/new -> it shows a
2006 Jan 27
17
Multiple Model Validation
Hey All ! I have a form which contains two models. I would like both models to be validated, but have their validations aggregated on the page. If I do: <%= error_messages_for(:model1) %> <%= error_messages_for(:model2) %> It puts two big validation blocks on the page. I would like all the errors from both models, but only in one validation box. Is this possible ? All my attempts
2006 Jun 22
1
error messaging for a form without ActiveRecord model
I have a form that has no ActiveRecord model behind it, it is just composed of random fields like "email_address", "email_body", etc. Even though there is no model, some of these fields are required, and I would like to use the built-in Rails methods for automatically showing errors in the form. Unfortunataely, I can only see how to do this if the form is based on an
2016 Apr 19
2
Best Pratice for installing samba package in production environment
Hi Helmut, Thank you for your mail. The distribution is Debian linux 7.9. I am talking of a fresh installation, and of course of it's update after. Thank you for helping. Regards Le 19 avr. 2016 06:08, "Helmut Hullen" <Hullen at t-online.de> a écrit : > Hallo, Jules, > > Du meintest am 18.04.16: > > > Is it recommended to install the tarball or archive
2006 Mar 20
5
Wrap error_messages_for() call when no instance var present
I am trying to put some smarts around a call to <%= error_messages_for %> so that when I first come into this page i.e. when my instance variable @target_list has not been defined yet, the page doesn''t break. I''m doing this: <% if @target_list? %> <%= error_messages_for ''target_list'' %> <% end %> I get a syntax error on line 1.
2016 Apr 19
2
Best Pratice for installing samba package in production environment
Hello Helmut, thank you for your feedback. I think that i am not making my self clear enough. Independant of the distribution, is it recommended to install Samba4 tar ball version in a production environment, or sernet package ? I know that with sernet you can have benefit of support, so it may be an advantage. But what about if i choose to install code source version downloaded from
2006 Feb 03
7
how to add multiple new records from one form
I''m trying to provide our customers with a page where they can add up to 20 items to their cart in one form. The form simply has 20 rows with each row containing a text input for product code and a text input for quantity. I''ve tried having the controller create an array that has an object for each row by looping through something like: @new_items[1] = Cart.new and the