similar to: [newbie] Question about form_remote_tag

Displaying 20 results from an estimated 5000 matches similar to: "[newbie] Question about form_remote_tag"

2006 May 19
1
validates_presence_of and ajax-forms
Hi. I have "validates_presence_of :login, :password, :firstname, :lastname" in my user-model. I enter the information in new_user.rhtml: <%= error_messages_for(:user) %> <%= form_remote_tag :url => { :action => :register }, :html => { :id => ''new_user'' } %> I have a register.rjs with :fade. Omitting firstname or any other required field
2006 Apr 04
1
using form_remote_tag and radio_button
I want the user to select a date using radio buttons. The following code shows the last 7 days. <%= form_remote_tag(:update => ''register_order'', :url => { :action => :register_orders } ) %> <% 1.upto(7) do |i| %> <%= radio_button "date", "register_date", i.days.ago.strftime("%Y-%m-%d") %>
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 21
0
Ajax page.replace_html model validation errors
I have the following setup: A model: that validates using helpers like: validates_presence_of, etc.. A view: called ''new'' which renders a partial The partial: _form which has error_messages_for and a form_remote_tag , submit_tag and end_form_tag An action ''create'': that gets executed via the submit_tag in the _form and which in case it can''t
2006 May 02
0
Model validation when using ajax & form_remote_tag...
I am trying to understand why model validation error reporting in Rails is so complicated compared to non ajax model validation. In my normal form I use <%= error_messages_for ''user'' %> in my view and I get a nice error message displayed when the user inputs invalid information into the form. When I convert that form to use Ajax using form_remote_tag the
2006 Jul 24
0
Ajax page.replace_html model validation render partial errors
Hi; I have the following setup: A model: that validates using helpers like: validates_presence_of, etc.. A view: called ''new'' which renders a partial The partial: _form which has error_messages_for and a form_remote_tag , submit_tag and end_form_tag An action ''create'': that gets executed via the submit_tag in the _form and which in case it can''t
2006 Feb 23
4
form_remote_tag params not passed .. PLEASE help!
This problem is driving me nuts Here is my code for the view: <div class="signW"> <div class="sign"> coming soon! <br/> <div class="stxt"> Email address: </div> <div id="result"> </div> <%= form_remote_tag(:update => ''result'', :url => { :controller =>
2006 Mar 26
4
Updating query results in real time with AJAX
I have the following view template: <%= form_remote_tag :update => "new_item", :url => {:action => ''create''}, :before => %(Element.show(''spinner'')), :success => %(Element.hide(''spinner'')) %> <div id="new_item"> </div>
2007 Jun 10
2
custom errors for validates_presence, etc..
I am trying to figure out how to customize the error messages when I use validates_presence_of. I am validating a user name and I use <%= error_messages_for ''user'' %> in my view to display the messages. I know you can customize in the model with :message =>''custom message'', but I am trying to get rid of the first part of the error message which is, 1
2006 Jul 13
1
error_messages_for
I can''t seem to figure out how to validate a few fields some1 please help me out model--------- class Record < ActiveRecord::Base validates_presence_of :sw, :flex end controller------------ class RecordController < A;;icationController def new @record = Rrecord.new @product = Product.find(params[''product_id'']) end def create
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,
2009 Apr 02
3
error_messages_for does not display the error
Hi all I''ve approached Rails since a couple of months to develop a quick application for my company. Fantastic framework. As every noob, I do have some gaps to cover. The one which is giving me a little frustration, generated by my lack of knowledge is as follows. I need to make sure the region object is not deleted if there are countries associated with it. I solved this by putting a
2005 Dec 31
2
Validation errors not displaying and will not save
Hello all, I''m fairly new to rails so I''m probably doing something really stupid here.... I have been banging my head at this for hrs now... I''ve tried so many different things and nothing seems to get me any further... I am trying to create an image uploading page that will simultaneously create thumbnails to separate file directories and update the database via
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.
2006 Apr 07
3
Ajax render a template
In my blog a user can add comments. I want an Ajax call to add the comment to the bottom of the comments list. How to i return a comment thats is in the comment template and add it to the bottom of the page. I have gotten as far as rendering some text back to the form and the comment doesn''t display until i refresh. This is my _newcomment.rhtml form to create a new comment <div
2005 Aug 15
2
Newbie rendering problem
Hi On every list request i render an item partial through a collection of items. the item table has 3 columns namely name,anotherName and id. the item partial looks like <%@item=item%> <%= error_messages_for(:item) %> <tr id="<%=item.id%>"> <% for column in Item.content_columns %> <td><%=h item.send(column.name) %></td> <%
2008 Feb 27
8
ActiveRecord validation messages not I18N-friendly and enforces grammar
ActiveRecord validation messages are currently not I18N-friendly. Specifically, I''m referring to the fact that it enforces a certain grammar, namely the beginning of the message must consist of the field name. For example: validates_presence_of :name, :message => "can''t be blank." ...generates the message "Name can''t be blank". This grammar
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.
2006 Jan 03
6
Am I going too far or Rails is just confusing? was {validates_presence_of *_id attributes}
Thanks for the input Blair Zajac and Chris (Nolan and Hall), and for others. If all of you have time, please follow this (the question still relates to the previous posts by me): I have provided full steps to reproduce the symptoms. If it matters, I''m running Ruby 1.8.2, Rails 1.0, and MySQL 5.0.15 on Windows XP Professional. 1. First, the setup MySQL ----- create database testdb;
2006 Aug 09
6
How to change the error message easy way
validates_presence_of :fname results in the error message "Fname can''t be blank". What I want is "First Name can''t be blank". I could do this def validate errors.add_to_base("First Name can''t be blank") if fname.blank? end I find this clunky and I have to put everyrhing in the validate method. Is there an easy to get what I want. I