Displaying 20 results from an estimated 600 matches similar to: "How to redisplay submitted data on validation error?"
2006 Jul 23
4
Anything like with_scope for ActionController?
There are areas of my application that "want" to use a url structure
like
domain/<human_readable_param>/<Module>/<Controller>/<Action>/<Id>
Please note that the human readable parameter I need to inject is NOT
related to the <id> being used by the action/controller pair. It''s
identifying a container object whose contains are operated
2013 May 27
6
Headache with Ajax in Rails using jQuery
Hello everyone, I''m a newbie at Ruby on Rails. I spent nearly two days
of the Memorial Day weekend stumbling upon making Ajax working in Rails.
At this point, I''m so exhausted and hope that I can get some help to
move forward. I have tried nearly everything I found on Google but
still not successful. Initially, I tried the Ajax approach offered by
Rails but did not work, so I
2006 Apr 14
2
Puzzled with filters
Hello everyone!
I''m trying to create an after filter for all my actions in all
controllers. I put it in application controller (application.rb).
class ApplicationController < ActionController::Base
after_filter :tidyit
def tidyit
xxxx # syntax error - intentionally
end
end
I have a Example (example_controller.rb) controller with index action.
class
2005 Dec 05
3
Effect.Highlight on Ajax.Updater
Hello to all list members...
Exchuse for my bad english, I don''t write english very well.
I''m searching for a solution to hilight a div when his value change.
The value in these div is take from Ajax.Updater .
the code is:
new Ajax.Updater(''acc'',''tools/head_info.php'',{asynchronous:true});
and have a settimeout to recall it every 5 seconds.
2007 Jul 14
2
Using Helpers inside a Controller
I want to use helpers inside a controller method for an AJAX
application. After the page is loaded and displayed, there will be an
asynchronous javascript request to load additional resources such as
html forms and other data.
The controller which handles the request will collect the resources and
send them back in json format.
def get_resources
data=Hash.new
data[:form1]=form_helper1()
2006 Mar 14
2
rjs woes
i''ve just installed the RJS plugin per cody''s instructiuons and read through
tutorials. I''ve made the necessary changes to my existing code and
everything appears to be working, except that the returned javascript is not
being evaluated...
here''s my setup:
i have a checkbox with an onclick event pointing to a javascript function.
this javascript function does
2007 Jun 23
2
Highliting a text in a plot
Hi everyone,
I want to highlight something in a plot.
So I want to write a text with a yellow background.
I tried to make use of text(x,y,"hallo",bg="yellow")
but that does not work.
I know I am a handful. Sorry!
Maja!
--
2005 Dec 19
4
need some help designing my messaging system
I am trying to create a messaging system for my users but I''m having a
hard time designing my db. This is what i have in mind, but I am not
sure if its the best approach.
user has_one inbox
user has_one outbox
inbox has_many messages
outbox has_many messages
inbox table
user_id
outbox table
user_id
messages table
box_id (refers to either inbox or outbox - how?)
from_id
to_id
2006 Feb 16
4
newbie question regarding basic AJAX form verification
Hi,
I''m confused about how form verification with AJAX works. Let''s say I have a
''new.rhtml'' view that contains a form with two fields, and the form action is
''create''. Let''s assume that I also want to do some type of data validation on
one of the two fields via AJAX before I submit the form. But since I''ve
already
2006 Apr 18
6
Best Practice for Returning to Calling Page?
I have a partial, it''s a shopping cart display, it''s designed to appear
on several different pages of my site.
One of the buttons on the shopping cart empties the cart, and then I
want the calling page to redisplay.
In other words, the cart controller needs to return the visitor to the
same page -- however since the cart could appear on any given page, this
has to be
2007 May 23
8
Rails Rendering diagnostics.rhtml in Controller Spec
Forgive me if this isn''t the proper list. It''s specific to the rSpec
Rails plugin.
The problem is, some controller actions are rendering the
"diagnostics.rhtml" template when I''m expecting it to render something
else in a controller spec. I''m assuming this is the template that
displays the error message and a stack trace when an error is raised
in the
2006 Apr 17
2
Refreshing RHTML page with previously posted data?
All,
After a POST, I want to be able to redisplay a view with the data that
was previously entered when my controller action notices a validation
failure and calls render on the view that does the submit.
Example:
View x.rhtml - text field is filled in
Call controller action
Controller action fails validation calls render (:action => ''x'')
x.rthml shows up with blank text
2007 Oct 04
5
Specs and Libs
How would I go about writing specs for a lib, particularly one with
all protected and private methods. I''m trying to spec the
AuthenticatedSystem library from the rails restful_authentication
plugin:
http://pastie.caboo.se/103625
Also, when you''re mocking objects, a side-effect is helping you
define the api of the object. Is there a way to get all the
behaviors that
2006 May 15
4
Ajax callback w/o model update?
Is there a way to keep a controller instance variable across a
link_to_remote call?
In essence, I want the call to re-render a partial within my page with
different display parameters, but without doing another DB call. Is
there a simple way to do this?
2006 May 05
16
Diff tool for OSX
I''ve looked for DIFF tools for OSX but haven''t found anything good
yet. Tried guiffy (http://www.guiffy.com) but it''s very slow and the
folder comparison doesn''t indicate a change until you drill down to
the level with the difference which kinda defeats the purpose.
I''m missing TortoiseSVN and the diff tool that comes with it. Any
suggestions for
2006 Apr 28
1
beginner - default form values
I want to build a simple calculator with 1 form and a results page.
The form will be redisplayed with an error message upon an invalid value
entered.
I won''t be using any database/active record for this.
The problem i have is when i return to the form page i want to redisplay
the values already entered in the form fields.
Should i use text_field (which seems to be tied to a model) or
2006 Jan 24
5
Password fields and security?
Hi all
I wanted to ask why Rails'' password_field helper uses the input password
as default value when reloading a form because of errors? Isn''t this a
potential security leak? On any other webs I''ve seen so far the password
fields have to be filled in again after every reload of the site so the
password doesn''t exist in plain text in the html code...
What
2011 Dec 19
2
Jquery Modal Dialog with Jquery DatePicker field strange behavior
Hi people.
I need your help here, please.
I have a rails 3.0.9 app, and I''m using Ajax to save some records to
the database. To achieve this, I use a jquery modal form, but one of
the fields is a datepicker, and if I click on it to display the
calendar it doesn''t work.
The thing is, I press submit without fill all the fields, so, my
custom validations were shown, telling me
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 Feb 23
1
Ajax, validation, flash messages & redirects...
Hi everyone,
I''m working on an file upload page that uses an ajax progress bar
(http://sean.treadway.info/demo/upload/). I''ve also got validation on
the uploads (must be a certain file size/mime type etc). When uploads
pass validation - all is dandy. But when they fail - I can''t work out
how to redisplay the form with the flash error messages (that normally
appear