Displaying 20 results from an estimated 10000 matches similar to: "Rails 3 UJS and delete action"
2011 Sep 06
8
Ajax and rails 3 UJS (jquery)
Hi, guys,
I''m in the midst of moving an app from rails 2.3.8 to rails 3.0.9.
Sadly, rails 3 no longer has javascript generators and I''m now forced
to do more javascript.
For my project, I have selected jQuery as the javascript framework for
my rails 3.0.9 app.
What I have done to have my app''s deletion link (for each item)
trigger an alert box when the deletion
2010 Sep 04
0
CSRF protection not working with jquery ajax post request
Hallo,
I want to test the csrf protection of my application but forgery
protection is not working with jquery ajax request.
I have used Unobtrusive Javascript with jquery
I have removed the
<%= csrf_meta_tag %>
so that my application do not include authenticity token.
In my view I have the following code
$(function () {
$(''#alert'').click(function () {
$.ajax({
2008 May 30
0
UJS for rails plugin Installation problems
Hello,
I downloaded and installed the latest UJS plugin.
I first got the error "uninitialized constant UJS" and this error wouldn''t
go away no matter where I place the "UJS::routes" line in the routes.rb
file. The only way I found to get rid of this error is to run "rake
tmp:sessions:clear" but then I get another error which is "can''t convert
2013 Jan 09
4
CSRF resets my session in Firefox
Hello all,
I''ve been trying to diagnose an issue with CSRF and Firefox
specifically. I''ve got an ajax based form, using UJS (yes, I have
csrf_meta_tag in my layout and I''ve tried adding the X-CSRF-Token header
to the ajax beforeSend events without any luck)... The form just posts
some data to an ajax method that creates, saves, and sets the session
for a shopper as
2010 Aug 14
1
Rail3: UJS submit after client-side validation
I am have some problems with UJS. I have a (potentially) large form
that I was doing client side validation on (yes there is also some
server side validation) using an old prototype validation routine that
is not working with the current version.
I actually got validation to work by coping and modifying some of the
rail.js routine to observer submit. I also had some javascript toggles
that I got
2006 Oct 04
0
UJS Plugin - apply_behaviour Question
Anyone using the Unobtrusive Javascript for Ruby On Rails Plugin?
I have some code that looks like this.
<% apply_behaviour ''select:click'' do |page, element, event|
page.insert_html :top, ''the_list'', "<li>hi</li>"
end %>
What I would like to do is list the element.value rather than the string
"hi" but I''m a
2010 May 12
1
Rails 3: perform controller action upon selecting menu item (UJS?)
In Rails 3, I have a form that has a menu on it. I would like to
render an area containing text fields within the form differently
depending on what''s selected in the menu.
Prior to Rails 3, one way it appears I could do this is by using
observe_field on the menu and call an action in my controller that
renders the appropriate partial which could then be swapped into a div
in my form.
2010 Sep 21
7
Ajax CSRF in Rails3
I''m using rails3. It does not seem to check the authenticity_token
when doing a POST using Ajax. I traced this to:
module ActionDispatch
class Request < Rack::Request
.....
def forgery_whitelisted?
get? || xhr? || content_mime_type.nil? || !
content_mime_type.verify_request?
end
end
so you don''t check if its a get? or a xhr? (ie ajax request). Is this
correct?
--
2006 Dec 27
13
Where did UJS go? UJS vs. RJS
I have not been able to access the UJS site, http://www.ujs4rails.com/
for two days. Does that mean there are problems or that it has been
incorporated into Rails core?
In general, what do you think of using UJS instead of RJS?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
2006 Jun 05
1
Unobtrusive javascript...what if?
What if...you could produce accessible, unobtrusive javascript, using
Rails built-in javascript/prototype helpers, with just one extra line
of code in your layout, a plugin, and one small enhancement to the
helpers. Something like this:
[php]
<% form_remote_tag :controller => ''foo'', :action => ''bar'',
:unobtrusive => true %>
# which produces
2011 Oct 03
0
rails ujs, multiple ajax requests
Is there a way if you have multiple say products(example) to comment with
ajax on each one inline? I cannot seem to pass anything other than the
id. products have may comments
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit
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
2011 Sep 19
1
Rails and UJS guide - not having much luck
I refered to http://railsdog.com/blog/2011/02/28/callbacks-in-jquery-ujs-in-rails3/
in hope of getting json data from my controller and displaying it in
my view when an ajax request is made.
I followed the instructions on the http://railsdog.com/blog/2011/02/28/callbacks-in-jquery-ujs-in-rails3/
and even corresponded with the author and also implemented his ''fix''
in
2010 Dec 20
2
The Rails3 way for in-place editing
Currently I want to implement in-place editing directly on the index-page
(for the sake of learning just xx products with a name to be edited).
These are my favorite links from yesterday''s research (for the archives):
*On the spot is a Rails3 compliant unobtrusive javascript in-place-editing
plugin: http://rubygems.org/gems/on_the_spot
2011 Aug 28
1
Page Caching, CSRF, and Loading a form via Ajax
Hi all,
I would like to use page caching on my homepage, but also want to
enable people to sign in via a modal dialog sign in form. I could
have a setup in which when a user lands on the cached homepage, an
Ajax GET request pulls in the whole login form so that there is a
fresh authenticity token.
That said, besides the additional hit to the server, the CSRF token in
the head area of the page
2006 Aug 01
0
Unobtrusive Javascript for Rails 0.2
Dan Webb (http://www.vivabit.com) and I are happy to announce the
latest release of the Unobtrusive Javascript plugin for Rails. This
release packs in lots of cool new features, a few changes to old ones
and some performance enhancements.
Now you can write your behaviours in Ruby, attach behaviours directly
to elements using content_tag and apply behaviours to elements
without HTML IDs.
2011 May 25
1
trouble using jQuery in Rails 3.0.7
I''ve tried to install JQuery a couple of times now, and I''ve followed
the steps for Rails UJS mentioned here:
https://github.com/rails/jquery-ujs
The last time I went ahead and added jQuery UI as well:
$ rails generate jquery:install --ui
remove public/javascripts/prototype.js
remove public/javascripts/effects.js
remove public/javascripts/dragdrop.js
2013 Jan 16
0
Rails 3.2 jQuery JSONP request not working - Moved Permanently
I am trying to send a POST request ( ''remove_tag_named'' )and getting a
simple OK back on success ; it doesn''t work..
the post is correctly sent , but after then it''s looping on sending a GET
request to the same url, with the error
301 Moved Permanently
I should not be far fro the solution, but I am stuck :
In my routes.rb
*namespace
2007 Jun 26
1
ActiveRecord: Attribute Setter for belongs_to relation attribute
Hi,
I m trying to link into the process of setting an belongs_to attribute
in my model. Unfortunetly, it does not seem to be as easy as for
"normal" attributes.
I ve tried the following:
class Treatment < ActiveRecord::Base
belongs_to :drug
def drug=(new_value)
''my stuff
super new_value
end
However, that does not work. Ive also tried self[:drug] =
2008 Feb 08
2
update_Attributes stale Object error
Hi,
IN one of my unit tests I get an ActiveRecord::StaleObjectError:
Attempted to update a stale object
object.save!
in object I have apart from other stuff an after_save method, which
calls
object.assosication.update_attributes(...)
If I remove that line from my code my tests succeeds.
Unfortunetly, I do not understand why an update_attributes call can
generate an StaleObjectError.
Maybe