Displaying 20 results from an estimated 2000 matches similar to: "Help with first AJAX action"
2006 Apr 05
1
an instance of one model in another model''s definition?
Hi all,
I am creating a multiple-storefront shopping cart in Rails, and have run
into a small problem. In addition to the cart, line-item, product, and
order models (pretty much standard for this sort of thing), I have a
Storefront model which locates the current storefront (by examining the
domain name), and initializes itself. This works fine throughout, and by
declaring a
2006 Apr 24
0
Web Services/Invoke Inconsistencies
Hey all,
Got a bit of a long one here, so bear with me while I try to hash out
the details... better to give too much than not enough.
So we''re using the ActionWebService in order to communicate with a
3rd-party software client. We''ve created the API as discussed in Agile
Web Development, and, in fact, invoke actually works perfectly.
We have three example XML posts... they
2006 Apr 12
1
pluralization issue? (taxes/taxis)
Hi all,
Here''s an odd one. I have a "Tax" model which is related via a habtm
relationship to a "Storefront" model. In my view_store rhtml file, I
have the line :
@storefront.taxes.each do |tax|
This line returns the following error:
NameError in Admin#view_store
Showing app/views/admin/view_store.rhtml where line #52 raised:
uninitialized constant Taxis
See
2008 May 01
3
Adding script line give errors Help!
I am trying to add this script
<script language="javascript" type="text/javascript" src="http://
www.expedia.com/pubspec/scripts/storefront/expe.sf.vertical.350.asp?pid=&aid="></script>
To my idex page and it give me errors, when I delete this line <script
src="js/lightbox/prototype.js" type="text/javascript"></script>
2009 Jul 29
3
Wine can no longer access port 80
I play a lot of games on Linux so I compile Wine from source and run it from the source directory to allow multiple versions and configurations. A couple weeks ago I started noticing errors whenever Steam tried to display a web page which was no biggie since I never use the storefront and I just chalked it up to Steam being buggy. But then I noticed the same error popping up in other programs
2005 Nov 03
2
[OT] CamCommerce
I was really excited today when a colleague gave me a lead on what I had
hoped might become my first production Rails site. Almost as quickly, my
joy began to fade upon speaking to the client. He wants a storefront
that integrates with his existing POS database...a product called
CamCommerce.
A bit of research on this software (I''d not heard of it) suggests that
the database backend that
2006 Jul 03
2
rjs renders string or partial but not template or action
Hi,
I have an rjs file. I only have one controller called called front. I
have views called "new_title.rhtml" and "_new_title.rhtml"
These work
page.replace_html ''title'', ''new title''
page.replace_html ''title'', :partial => ''new_title''
page.replace_html ''title'',
2006 Aug 14
1
Postback Action Problem
I was trying to use postbacks, but its not working.
def edit
@xxxx= xxxx.find_by_id(params[:id]) || xxxx.new
if request.post?
@xxxx.attributes = params[:xxxx]
redirect_to :list and return if @xxxx.save
end
end
I get the following error: SystemStackError in xxxxxController#edit
stack level too deep. The code of list is same as the code generated by the
scaffold
2005 Dec 26
0
[rjs] How can I render a action template instead of partial
Hi,
I want to render a action template with rjs, so instead of doing this:
page.replace_html ''maincontent'', :partial => ''list'' I want to do this:
page.replace_html ''maincontent'', :action => ''list'' but the render (that
is called by replace_html, outputs to the reponds_body), so it doesn''t work.
Is there a
2009 Mar 05
3
How to render :partials *before* the :action has finished ?
Hi there,
I''m sure a lot of you guys have come across this question:
How can we render several :partials on a page *before* the called
:action has finished?
Basically, my situation is this:
When I click on a certain button, 3 things are supposed to happen:
- INSTANTLY: the button should become disabled (either by setting
":disabled" to "true" by updating the
2006 Feb 16
7
RoR vs JavaScript/AJAX vs Java interface. Conflicting ideas?
Hi,
Over the past month I''ve been playing with some ideas for an admin
interface for a ecommerce app.
1) Old-fashioned, forms-based, full-page-refresh, server-focused interface
2) Modern, JavaScript-Drag-Drop, AJAX, client-focused, Web2.0 interface
The more I work on the second option with JavaScript an AJAX the more
I feel like I''m moving away from building a server side
2006 Jul 26
0
page.replace_html render(:action => ''other_action'')
I want to be DRY. I have a controller action, component, that renders
html.
I have another controller action, component_update, that returns RJS:
This what I''d like for ''component_update.rjs'':
page[params[:scaffold_id]].replace_html render(:action => "component",
:layout => false)
page[params[:scaffold_id]].visual_effect :highlight
But, the render is
2006 Mar 31
0
update a div element without having a corresponding action
Rails group,
I''m looking to update a div element with a page link without having
to write a corresponding action to populate that element.
I''ve tried:
<%= link_to_function "cancel", page.replace_html("control", :partial
=> "controls") %>
Basically I''m trying to limit the amount of methods that serve my
Ajax calls that only
2006 Jun 27
3
find_by_id vs. find in postback action
I''m playing around with the Postback action recipe listed in the recipes
book.
Here is the default code given:
def edit
@recipe = Recipe.find_by_id(params[:id]) || Recipe.new
if request.post?
@recipe.attributes = params[:recipe]
redirect_to :main_url and return if @recipe.save
end
end
Here is what my code sort of ended up looking like, altho i''ve ripped it
apart
2006 May 10
2
Redirect whole page from AJAX action that updates a div
Hi,
I am calling an action via AJAX to update a div. The action needs to
redirect the page in under certain circumstances. However, if I just use
"redirect_to" in the action then of course what happens is that the page
I want to redirect to replaces only the div, not the entire page, and I
get messy nested layouts.
Is there a way around this? Can I redirect the entire document from
2006 Apr 18
0
AJAX not displaying - due to action not complete?
Hi everyone,
I''ve got a pair of AJAX actions that use slide_up and slide_down to
toggle the editing of some info. You first see a table of
entitlements for a user. Clicking "Change these" slides that up and
then a full table comes down, displaying all possible entitlements for
that user. Remove and Add links are next to the appropriate
entitlements. When finished, clicking
2006 Feb 22
0
Can you make an HTTP request inside an Ajax action?
I have a regular controller action which, when called, makes an HTTP
GET request to another server. That works fine. I''d like to throw
that inside an action called with link_to_remote, but that''s having
problems. The error I get follows. Any ideas?
Pat
http://localhost:3000/main/ -> /javascripts/prototype.js
[2006-02-22 06:08:11] ERROR ThreadError: timeout within
2006 Jan 26
2
link_to_remote > in :action , interrupt ajax to render a new page outside the :update div ?
Hello,
I have a simple link_to_remote that refresh a div. I just want to know
if it''s possible to interrupt the div''s refresh inside :action to
perform a complete reload of the page, outside of the div
Actually, I havea a new page, but loaded inside the ":update" div.
Someone have an idea please ?
the rhtml:
****
link_to_remote "yeah" , :update =>
2006 Jan 26
1
Action variables not available in views with Ajax
The title pretty much describes my problem.
I have a standard Ajax call to an action the updates a portion of my view.
However, variables set inside the action are not available in my view. In
fact, NOTHING that happens in my action seems to affect my view. Calling
render :layout => false still gives me the flipping layout.
However, I know the Ajax call itself is working because I can do
2006 Oct 23
0
Invoking a remote (AJAX) action via double click
I have a list of images on one of my pages, and I would like for the
act of double-clicking on any of them to do a remote request to an
action. In this case, I''d like to pop up a redbox that is a dialog
about the item I clicked on. I found some example code like this:
<%= image_tag "image.jpg",
:class => "image",
:ondblclick =>