Git Product home page Git Product logo

muriel-salvan / rails-ajax Goto Github PK

View Code? Open in Web Editor NEW
40.0 40.0 12.0 1.07 MB

Add Ajax capabilities to Rails websites, with minimal code changes. Supports history, bookmarking, partial refreshes, Rails flashes, user callbacks, scripts execution, redirections. Built upon Rails-UJS and jQuery.

Home Page: http://rails-ajax.x-aeon.com

License: Other

Ruby 47.37% JavaScript 0.96% CSS 0.47% HTML 27.34% Gherkin 23.86%

rails-ajax's People

Contributors

muriel-salvan avatar rrrene avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rails-ajax's Issues

Links to external websites should not be handled with Ajax

When link_to helper links to an external website, Ajax should not be used.

Not sure if this feature is already implemented or not, as it depends whether Rails handles the data-remote="true" attribute when using external links.

However this ticket will still remain opened until it is at least tested successfully.

preventing my JS codes from happening when rails-ajax is enabled

I followed your guide but I can't seem to determine what is wrong. I've tried disabling it in rails-ajax-config.rb and it worked. There are no JS errors whatsoever.

So apparently, it is rendering but not doing the JS stuff in my new.js.haml

Processing by SomethingsController#new as JS
My controller action comment is here...
[RailsAjax] render: options=[] block?false flash=#<ActionDispatch::Flash::FlashHash:0x00000007dd98f0 @discard=#<Set: {}>, @flashes={}, @now=nil> | Normalized arguments: {}
  Rendered somethings/_modal.html.haml (11.0ms)
  Rendered somethings/new.js.haml (14.8ms)

CSRF Token not valid after refresh_dom_with_partial

When I log out and log in without changing the main action again, I get a 422 error:
RailsAjax call failed with error 422 (OK): undefined - undefined

The console shows this:

Started POST "/sessions" for 127.0.0.1 at 2014-05-10 19:09:54 +0200
Processing by SessionsController#create as */*
  Parameters: {"utf8"=>"โœ“", "name"=>"S0lll0s", "password"=>"[FILTERED]", "commit"=>"Log in"}
Can't verify CSRF token authenticity
Completed 422 Unprocessable Entity in 1ms

The login form is in a partial (userbar) in the layout and gets updated like this when logging out:
refresh_dom_with_partial('aside#userbar', "userbar")

Rails 4.0 support

Hello,

I tried giving it a go myself, but I cannot test the gem and thus not be sure if an upgrade to Rails 4.0 will break everything.

> bundle --version
Bundler version 1.3.5
> rake test
You must `gem install bundler` and `bundle install` to run rake tasks
/usr/lib/ruby/1.9.1/rake/version.rb:2: warning: already initialized constant VERSION
/usr/lib/ruby/1.9.1/rake/version.rb:5: warning: already initialized constant MAJOR
/usr/lib/ruby/1.9.1/rake/version.rb:5: warning: already initialized constant MINOR
/usr/lib/ruby/1.9.1/rake/version.rb:5: warning: already initialized constant BUILD
/usr/lib/ruby/1.9.1/rake/version.rb:6: warning: already initialized constant NUMBERS
/usr/lib/ruby/1.9.1/rake.rb:27: warning: already initialized constant RAKEVERSION
/usr/lib/ruby/1.9.1/rake/early_time.rb:17: warning: already initialized constant EARLY
/usr/lib/ruby/1.9.1/rake/alt_system.rb:32: warning: already initialized constant WINDOWS
/usr/lib/ruby/1.9.1/rake/application.rb:31: warning: already initialized constant DEFAULT_RAKEFILES
WARNING: Possible conflict with Rake extension: String#ext already exists
WARNING: Possible conflict with Rake extension: String#pathmap already exists
/usr/lib/ruby/1.9.1/rake/task_arguments.rb:77: warning: already initialized constant EMPTY_TASK_ARGS
/usr/lib/ruby/1.9.1/rake/invocation_chain.rb:49: warning: already initialized constant EMPTY
/usr/lib/ruby/1.9.1/rake/file_utils.rb:9: warning: already initialized constant RUBY
/usr/lib/ruby/1.9.1/rake/file_utils.rb:86: warning: already initialized constant LN_SUPPORTED
/usr/lib/ruby/1.9.1/rake/file_utils_ext.rb:16: warning: already initialized constant DEFAULT
/usr/lib/ruby/1.9.1/rake/file_list.rb:44: warning: already initialized constant ARRAY_METHODS
/usr/lib/ruby/1.9.1/rake/file_list.rb:47: warning: already initialized constant MUST_DEFINE
/usr/lib/ruby/1.9.1/rake/file_list.rb:51: warning: already initialized constant MUST_NOT_DEFINE
/usr/lib/ruby/1.9.1/rake/file_list.rb:55: warning: already initialized constant SPECIAL_RETURN
/usr/lib/ruby/1.9.1/rake/file_list.rb:61: warning: already initialized constant DELEGATING_METHODS
/usr/lib/ruby/1.9.1/rake/file_list.rb:364: warning: already initialized constant DEFAULT_IGNORE_PATTERNS
/usr/lib/ruby/1.9.1/rake/file_list.rb:370: warning: already initialized constant DEFAULT_IGNORE_PROCS
/usr/lib/ruby/1.9.1/rake.rb:68: warning: already initialized constant FileList
/usr/lib/ruby/1.9.1/rake.rb:69: warning: already initialized constant RakeFileUtils
rake aborted!
undefined method `+' for LL():Rake::Scope::EmptyScope

Could you please have a look?

Cheers

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.