Displaying 20 results from an estimated 30000 matches similar to: "Ajax calls in application.js (authenticity_token problem?)"
2008 Aug 25
1
prototype.js Ajax is slow
So I was doing some experimenting with prototype and ajax and discovered
something interesting. When I use the first ajax call the response from
the server take 53ms. When I use the second on using the prototype
functions the request from the server is over 200ms. My question is
why, and can it be fixed?
<p><a href="#" onclick="serverSideAlert();">Call
2013 Sep 19
0
CRUD model in a bootstrap modal with jquery, ajax - best practice
Hi,
i have an model, which i want to show edit and update in a dialog via ajax.
What i do at the moment:
To open the Modal and render the partial, i send an ajax request to
controller#show with ujs
this is the link:
<a class="person-dialog" data-remote="true" data-type="script"
href="/en/people/32" onclick="return false">Fidel
2009 Apr 08
0
authenticity problem with jrails ajax
I''m using jrails and I found when I use the authenticity_token in
certain javascript calls, that the
url works differently in that the paramters in the :with clause get
dropped if they are in a json type syntax.
Below is an example of a remote_function() call from JS that used to
work fine without authenticity.
When I enabled authenticity it adds the authenticity token
automatically, but
2006 Feb 01
1
Combine Ajax call with an effect.
Hello list.
I am a newbie with prototype, scriptaculous and with JS.
Right now, I have a successful ajax call that appears in my div
(thedescription) when I mouse over the link, and disappears when I
click on the link. What I would like to have happen is to combine
this with an effect (ie, onclick="new
2008 Apr 29
1
Making new Ajax.Updater within a previous Ajax.Updater call
I have a button which calls a form via Ajax.Updater:
<a href="javascript:void()" onclick="createMessage()">Create Message</
a>
<script>
function createMessage() {
new Ajax.Updater( ''content'', ''message.php'', { method: ''post'' } );
}
</script>
This is the message.php file:
<html>
<head>
2011 Mar 09
1
Javascript call from view.
Hello All,
I am working on a Microblogging application.(majorly written in Ruby
on Rails).(the application is similar to twitter) .There is a timeline
showing messages by the logged-in user and his/her
followers.
Each message has a reply link which has been coded as follows
<%=link_to "Reply" ,{},:href=>"#",:class => "replyMessage
noBackgroundImage" ,:title
2006 Jun 19
10
Trying to delete from a unordered list using ajax
I have a controller method as such:
def delete
@category = Category.find_by_name(params[:name])
@element_id = @category.name
Category.delete_all(["name = ?", @category.name])
end
(For the purpose of this exercise, category names are unique)
I have the corresponding delete.rjs file:
if @element_id
page.remove :id => @element_id
page.visual_effect :highlight,
2014 Mar 01
0
Rails AJAX slow compared to Node.js and websockets complex to implement in rails ?
I have heard alot about Node.js and watched a few tutorials and read some
stuff. I get the impression that in certain situations AJAX calls with
node.js is alot faster than with rails. I also have somewhat of an
impression that with Rails web sockets are complicated to implement but
with node.js web sockets might be alot easier.
I am trying to figure out if I should learn some node.js or
2008 Jan 23
2
CSRF / cached authenticity tokens / ajax requests
I''m going to go out on a limb here and say the new CSRF protection in
Rails is flawed. Why? Forget about caching if you care to use it.
Consider the following:
<% cache do %>
<%= link_to_remote "Add To Favorites", :url => {:controller =>
"favorites", :action => "create", "movie_id" => 2} %>
<% end %>
# Output
<a
2006 May 24
2
Which JS/Ajax library to use with RoR
Hello,
I am beginning to soak myself into JS/Ajax stuff and I am quite confused
because of the myriad of AJAX books/frameworks - Its even worse than RoR
in this sense (i.e. in the case of RoR, half of the people are writing
books on it, and i believe this value is even higher with AJAX ;-) Of
course this is not a bad thing, but if a newbie has to choose something
it can be really hard.
So my
2009 Feb 22
1
degrading ajax calls - how?
Hey - I have a few ajax calls in my app that I''m not really sure how to
degrade to html. For the most part, these are functions that insert or
remove elements to/from the dom.
For example, I have my own edit-in-place on the data, which is called by
start_edit action. This action renders an rjs template that replaces the
view with an edit form.
# view (partial)
<tr
2006 Feb 28
4
No action from AJAX link_to_remote...
AJAX & Ruby & Rails newbie here.
I''ve got a link to remote that I believe should be working, but doesn''t
seem in fact to do *anything*. I''m looking at the webrick log, since
the Book says I should be seeing some hot POST action in there, but
there''s literally no change when I click on the JS link. From looking at
the source that''s
2007 Aug 12
0
Newbie: AJAX not working - Undefined Method error
Hello
I have included prototype in my Applications rhtml file
<head>
<%= javascript_include_tag "prototype" %>
<title>FLYPRO </title>
<%= stylesheet_link_tag ''flypro'' %>
</head>
I call link_to_remote in a page as follows
<div id="flypro-list">
</div>
<%= link_to_remote("Do
2013 Mar 06
2
Refresh a partial onClick using ajax call in rails 3.x
Hi All,
I want to refresh a partial onClick, onClick i am making ajax call
and getting the data but i am unable to refresh the partial. here is the
code
IN views: home.html.erb
$(document).ready(function() {
var currentCellText;
$(".inline").click(function() {
currentCellText = $(this).text();
$.ajax({
type: ''GET'',
dataType: "json",
2006 Mar 01
1
prototype.js ajax w/ post - how to send ''+'' character
Hi,
I am trying to send input from a form to do a live php boolean search. so
an example
search string is
''+neoflex +standard +output -green''
the problem is something is filtering the ''+'' and i can figure out to to
send it.
here is the html and js that i am using.
<input type="text" id="prodid" onkeyup="autosearch(this)"
2005 Oct 19
1
js not executed after ajax.updater -- evalScript:true not a solution
Hi.
I have a <div> on a page that I replace with a new one using
Ajax.Updater. Inside this newly placed div, I am using classes and
behavior.js to launch various Ajax things and scriptaculous effects.
None of them, however, get triggered after the update. They also
fire no javascript errors or anything of the kind.
I''ve seen the option evalScripts with Ajax stuff-- but
2008 Feb 14
2
Quoting using JS in Rails 2
Hello all,
I''m looking for a good solution to provide "smart quoting" for an app
I''m making. The end-user workflow I''m hoping to accomplish is this:
* User reads entry, ie a blog post or a news article
* User highlights a passage in the entry in his browser
* User clicks a link in the page and a form appears. The form''s text
area should contain the
2007 Sep 06
1
semi-nube help request
just to show i''m not a complete dork: i receive emails from the list through
gmail and i''ve already searched for the answer to this problem and since
i''ve been a member i''ve not received an email about it. Google search
results are mixed at best.
so this is my problem:
i have a form:
<div id="container"
2007 Jun 19
0
Insertion of JS directly into ajax.updater div
Hi folks.
I''m trying to shove some Digg JS scripts into a div I''m calling
through an ajax.updater function:
<script type="text/javascript">
digg_url = ''http://domain.com/library.rbf?id=5'';
digg_bgcolor = ''#c9cc67'';
digg_skin = ''compact'';
</script>
<script
2006 Jan 16
11
Preventing bubble
I''m trying to prevent double ajax requests when I have nested onclick
handlers.
I have a table with clickable column headings (for sorting by that
column).
I have onclick handlers on both the <th> and the <a> link so that
clicking anywhere on the table heading should work.
<th onclick="window.location.href=''http://foo?sort=foo'';">