Displaying 20 results from an estimated 84 matches for "redisplay".
2006 Mar 23
3
How to redisplay submitted data on validation error?
Hi!
If i have an object it''s easy.
But i''m making a simple contact form and i check if email address is
correct. If it''s not i redisplay the form with the info that there was
an error (should i use redirect_to or render :action? what''s the
difference?), but all previously submitted data is lost.
I tried creating variables using names of the form fields, but it didn''t
work.
--
Posted via http://www.ruby-forum.c...
2010 Jul 08
1
[Rails3] Issue in modifying locale and redisplaying page
In a test app, I have a drop-down selection to change the language of
the site.
I use an Ajax request to an action in which the locale is changed, and
the it''s redirected to the home page
unfortunately, the locale seems to be changed but the home page
doesn''t reflect the new language ..
application_controller.rb
.. before_filter :set_locale
def set_locale
I18n.locale =
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 mode...
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 => '&...
2005 Dec 26
3
Override Validation?
Hi all,
is there a way to override the validation methods so as to avoid the
div.fieldWithErrors divs from being created on the redisplayed form?
Many thanks in advance,
Nicky
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 dynamic, not hard-coded.
So the solution I''m considering is to use params[:controller],
params[:action], and params[:id] as a uniq...
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 Feb 21
7
Validation issues
I have a form. Everything submits into the database if I don''t have any
validation rules. When I put these rules:
validates_uniqueness_of :title, :message => "already exists in
database"
validates_presence_of :title
I get this error (which seems weird because I am not validating against
that):
You have a nil object when you didn''t expect it!
You
2006 Jul 03
1
Model Relations, Creating, Errors and stuff
...d @staff_member.save
flash[:notice] = ''StaffMember was successfully created.''
redirect_to :action => ''list''
else
render :action => ''new''
end
end
However, if either of the models returns an error, the form gets
redisplayed with the errors (all well and good), but the successful
object is still saved.
EG. If I don''t provide a staff_member e-mail address (required), then
the app still goes ahead and saves the user info anyway.
How do I stop it saving the other model if one fails.
I thought about an if sta...
2006 Jul 08
1
Ajax, RJS, and Standard Form Errors
...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 redisplay
the edit action on the left, which I''ve had to make a partial for the rjs.
The problem is that the standard form error messages don''t show up. I think
they make be getting lost with the rjs since it''s not a redirect back to
the edit action.
Any ideas on how to solve t...
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?
2005 Mar 30
1
menu.c32, submenus
...0
The file dskdiag.0 if a copy of pxelinux.0 that I hex edited changing default to dskdiag.
When I run this setup default menu is displayed and I can choose the submenu (dskdiag). The submenu is then displayed, but when I choose "M" to go back to the top menu the submenu (dskdiag) is redisplayed. Any one have any thoughts on what is going wrong?
2008 Jul 08
2
select helper still the worth thing in rails...
I have been trying all the day to make it happen, initial display is
fine , but I cannot redisplay the selected value once the choice is
done in my select helper
I setup my slector in a helper (need to include the first option
''all'', as a prompt is displayed only once....
in my partial
def company_role_selection(selection=nil)
roles= [[''all'', 0]]
ro...
2006 Feb 23
1
Ajax, validation, flash messages & redirects...
...orking 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 when not using the ajax progress bar).
I''m new to RoR so apologies if i''ve missed something simple. I guess
this has to do with the form being submitted to a hidden iframe? So how
can I display the error messages to...
2006 Jan 22
3
file_column and tmp files
Hi again...
One more item.. the file_column plugin uses a tmp directory inside the
/public directory to store a temporary uploaded item. But it looks like
this folder is just going to grow and grow. Is there some way to clear
this out or not cause this to happen?
Thanks once again!
--
Posted via http://www.ruby-forum.com/.
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
2006 Jan 24
2
DOCTYPE declaration:
...le Rails development book again and
thought to see what effect, if any, placing a doctype declaration
at the top of an rhtml file would have. When I insert any of the
three standard forms of such declaration at the top of
app/views/store.rhtml the product image disappears when the web
page is redisplayed. The error logged in log/development.log is:
> ActionController::RoutingError (Recognition failed for
> "/images/product01"):
> /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_control
> ler/routing.rb:469:in `recognition_failed''
As I have ver...
2006 Feb 16
1
Help with validation
I am trying to write some simple code post a form, update the database
and do some validation. I have 2 problems:
1) The validation fails but I can''t get hold of the error message
2) I can''t get the form to redisplay the previously entered data for the
user to correct.
I have 2 controllers:
user and holiday.
A user can request a new holiday by filling in a form. I have a
request_holiday method in the user controller. My request_holiday.rhtml
sets up a form as follows:
<%= start_form_tag :controller...
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 16
17
AWDWR question
In an early section on Action View, showing code being put directly
into the rhtml file:
<% require ''date''
DAY_NAMES = %w{ Sunday Monday Tuesday Wednesday Thursday Friday Saturday }
today = Date.today %>
<h1>Hello, Dave</h1>
<p>
It''s <%= DAY_NAMES[today.wday] %>.
Tomorrow is <%= DAY_NAMES[(today + 1).wday %>.
</p>
I get this