Coder Social home page Coder Social logo

paloma's People

Contributors

bf4 avatar biaesmero avatar daniely avatar daraul avatar fmbiete avatar johnknott avatar jritter avatar jurajmasar avatar kbparagua avatar monkbroc 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

paloma's Issues

Nestes Routes

The documentation says nothing about nested routes. Can paloma deal with nested routes?

IE 8 new actions

When using IE8, this will cause a javascript error (expected identifier...):

var ControllerName = Paloma.controller('ControllerName');
ControllerName.prototype.new = function() {
}

This is the correct sintax for IE to work:

var ControllerName = Paloma.controller('ControllerName');
ControllerName.prototype["new"] = function() {
}

General code not working after link is clicked (only when refreshed)

Hello there.
I have just installed Paloma and I have one general_code.js that is available throughout my whole application and controller_specific.js files. When I open a page, everything works as expected, but if I click a link the code placed under general_code.js does not work. If I hit refresh it works again... any ideas here?

Install issues?

I'm trying to use your gem in a RoR 4.0.2 project.

I'm installing the gem via the Gemfile:

gem 'paloma', '>= 3.0'

Looks like the install goes just fine, but the app can't 'load the paloma resources:

//= require paloma

I don't see anything paloma related installed into the project e.g. /vendor/assets/javascripts etc.

What am I doing wrong / missing? The Readme doesn't indicate that a generator or anything needs to be run.

TIA - Peter

Not executing javascript after validation failure (using AR)

I know this might be rails fault but I think it's a pretty common scenario.

When I try to save a record and for some reason validations don't pass the url changes from /model/new to /model which obviously breaks paloma.

I endup doing something like this to solve this problem:

function code_for_new(){ //something };

XXXController.prototype.create = function(){
code_for_new();
}

XXXSearchesController.prototype.new = function(){
code_for_new();
};

But I'm sure there should be a better solution (Without using remote: true).

Thanks,
ascoppa

Why action are stored in session ?

I have a question about goal of rails part. Why paloma_request are stored in session and not only scoped to request ? As side question what is the goal of having multiple request on the same html result page.

It's cause me some troubles. Because not just html page are tracked into session (track_paloma_request is not limited to html render). So json call come back to session[:paloma_requests] and dumped to random html page. Don't understand why is done like this.

Anyway palome is good idea.

Ajax support?

I just stumbled upon this gem and love the idea.

However, after reading the readme I was under the assumption that a callback function would be triggered whenever the corresponding Rails controller was hit, which is not the case when using an ajax request.

For example, using the example in the readme:

Paloma.callbacks['users']['new'] = function(params){
    // This will only run after executing users/new action
    console.log('Hello New Sexy User');
};

Loading the app in the browser and then sending a simple ajax request using jQuery:

$.get('/users/new');

does not trigger the users/new callback function.

Also, when would the Paloma.callbacks['users']['create'] function that is referenced in the generators section of the readme ever be executed?

Call a initialize method before excute the action method

Example:

var ArticlesController = Paloma.controller('Articles');

ArticlesController.prototype.initialize = function() {
  // Do some controller wide work.
};

ArticlesController.prototype.new = function() {
  // Blah blah
};

I think it's useful when we have some controller wide js code.

Paloma incompatibility with rails/info/routes (rails 4)

I'm getting the following error when using paloma and trying to access to rails routes page (http://localhost:3000/rails/info/routes

Started GET "/rails/info/routes" for 127.0.0.1 at 2014-01-14 18:04:29 -0300
Processing by Rails::InfoController#routes as HTML
......
Completed 500 Internal Server Error in 63ms

ActionView::MissingTemplate (Missing partial paloma/hook with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :raw, :ruby, :jbuilder, :coffee]}.

calling js by itself now causes error

I have this code:

js false, except: [:edit, :new]
  def new
    js
    super
  end

This used to work before upgrading to 4. Now it causes an error:

ArgumentError (wrong number of arguments (0 for 1..2)):  app/controllers/registrations_controller.rb:6:in `new'

I fixed it by changing the code to be:
js '#new'

JS errors on mounted rails engines

Including controller extensions on ActionController::Base causes javascript errors on pages rendered in rails engines since they don't load the paloma javascript. Paloma controller extensions should be optional instead of globally included.

namespaced controllers

Namespaced controllers don't seem to work.

I tried adding admin/controllername/edit and it seems to still look for controllername/edit. Also, it looks like the generator doesn't crate all the necessary files anymore.

Paloma does not load Controller & action for ajax

I configure within routes.rb so that Controller Chat nested within Controller Page

  • When I open web browser for the first time, access url: http://localhost:3000/pages/1
  • This page with automatically make ajax call to: http://localhost:3000/pages/1/chat
  • In the console log of firebug, I realize that Paloma did not load the mapping to Controller Chat, action Index
  • But, when I refresh the page, console log showing that, it has loaded properly the Controller Chat, and action Index
  • Since then, everything works properly.

This issue only occurs when open web browser, at firstly access to "http://localhost:3000/pages/1"

Passing params : undefined method `js' for #<PostsController:0x00...>

I am getting this error when trying to pass parameters to the js object via the controller.

  def show
    @post = Post.find(params[:id])
    js :params => {:post_id => params[:id]}
    respond_to do |format|
      format.html # show.html.erb
      format.json { render json: @x }
    end
  end

Paloma is otherwise working correctly, loading js files as expected.

Paloma 4 not clearing past actions with turbolinks

Hi,

I was using Paloma 3 without problems. After updating to Paloma 4, removing my Router and including the js option in each action, as in the readme, I'm seeing the past actions executing always.

I access my front page, the dashboards#index is executed.
Click a link to go to the front-page, the dashboards#index is executed 2 times.
Click again, 3 times, again, 4 times...

- FIRST TIME I HIT THE PAGE -
Paloma: Execute Dashboards#index with
Object {}
Tue Feb 18 2014 13:12:38 GMT+0100 (CET) page:fetch
- SECOND REQUEST - GET http://127.0.0.1:3000/dashboards
Tue Feb 18 2014 13:12:39 GMT+0100 (CET) page:receive
Paloma: Execute Dashboards#index with
Object {}
Paloma: Execute Dashboards#index with
Object {}
Tue Feb 18 2014 13:12:39 GMT+0100 (CET) page:load
Tue Feb 18 2014 13:12:42 GMT+0100 (CET) page:fetch
- THIRD REQUEST - GET http://127.0.0.1:3000/dashboards
Tue Feb 18 2014 13:12:43 GMT+0100 (CET) page:receive
Paloma: Execute Dashboards#index with
Object {}
Paloma: Execute Dashboards#index with
Object {}
Paloma: Execute Dashboards#index with
Object {}
Tue Feb 18 2014 13:12:43 GMT+0100 (CET) page:load

My application is using turbolinks, and jquery-turbolinks

Two root elements in callback parameter

Hello,

I'm using paloma in my Rails project and I think it's really useful ! It avoids annoying bugs that occur when javascript is executed on pages where it shouldn't.

Anyway I was using it on a rails 4 project and everything was working fine. I downgraded to 3.2 due to gem compatibility problems and I have a strange behavior with parameters.
In my controller I have the following code:

def show 
    @event = Event.find(params[:event_id])   
    js :params => { event: @event }
end

In my JS code I used to get the parameter like this

var event = params['event'];

And then I would access to the event properties like event.id or event.name

But after downgrading to rails 3.2 (not sure that's the direct cause), I need to do this

var event = params['event']['event'];

What is going on here? If I add another parameter like an integer it works fine. For example

js :params => { event: @event, id: @event.id }

I can access the id via params['id']
How can I go back to the old behavior?

Add support For Arbitrary Paloma Start

Currently Paloma is started from the hook, but this makes it difficult to incorporate into existing applications or applications where JS code needs to execute before Paloma runs.

Obviously Paloma.engine.start(); can be called from anywhere, but it is hard-coded into the hook.

Please add a config options such as auto which, if set to false, doesn't start the engine in the hook, allowing it to be started when most appropriate in the application.

Can't run test app with Rails 4

Running bundle install gives me this error message:

Bundler could not find compatible versions for gem "activerecord":
  In Gemfile:
    generator_spec (~> 0.8.7) ruby depends on
      activerecord (< 4.0, >= 3.0) ruby

    rails (>= 3.1.0) ruby

[request] Add helper to bundle multiple views

It would be great to be able to do something like:

ArticlesController.bundle(["edit", "update", "index"], function(){
  // Actions shared by all three
});

This could just be a helper method that does exactly the same thing as calling them individually.

Paloma breaks Capybara

Hi, nice gem! I'm running in an issue though. Paloma is adding HTML tag after the . As a consequence, when Capybara tries to check have_content?, it fails with:

Ambiguous match, found 2 elements matching xpath "/html" (Capybara::Ambiguous)

Why action are stored in session ?

I have a question about goal of rails part. Why paloma_request are stored in session and not only scoped to request ? As side question what is the goal of having multiple request on the same html result page.

It's cause me some troubles. Because not just html page are tracked into session (track_paloma_request is not limited to html render). So json call come back to session[:paloma_requests] and dumped to random html page. Don't understand why is done like this.

Anyway palome is good idea.

Automatically disable paloma when send_file or send_data is detected

I was having this error

undefined method `[]' for #<File:0x007ff8f3cf1e78>

When trying to use send_file. I found in one of your closed issues a mention of using js false to disable paloma, but I wondered if this couldn't be done automatically, or at least not raise an error in the first place but fail silently if the renderer doesn't comply?

Changes from Paloma 3 to 4?

Could the README be updated to make it clearer what changes were made between version 3 and version 4? Right now I believe that most of it is still written with the assumption that a visitor would be upgrading from version 2.

I know 3 was only out for a short time, but our project makes use of it and we're trying to identify what we may need to change when we upgrade to 4.

Thanks.

Callback not called back

Hi, I've just installed paloma and created some actions. In my paloma/transactions/index.js file I got

Paloma.callbacks['transactions/index'] = function(params){
alert('Index!');
};

This file is correctly included in the HTML file, but the callback is not called anywhere else.

<script src="/assets/jquery.js?body=1" type="text/javascript"></script> <script src="/assets/jquery_ujs.js?body=1" type="text/javascript"></script> <script src="/assets/paloma/paloma.js?body=1" type="text/javascript"></script> <script src="/assets/gmaps4rails/gmaps4rails.base.js?body=1" type="text/javascript"></script> <script src="/assets/gmaps4rails/gmaps4rails.googlemaps.js?body=1" type="text/javascript"></script> <script src="/assets/paloma/transactions/_local.js?body=1" type="text/javascript"></script> <script src="/assets/paloma/transactions/bubbles.js?body=1" type="text/javascript"></script> <script src="/assets/paloma/transactions/index.js?body=1" type="text/javascript"></script> <script src="/assets/paloma/transactions/_callbacks.js?body=1" type="text/javascript"></script> <script src="/assets/paloma/index.js?body=1" type="text/javascript"></script> <script src="/assets/application.js?body=1" type="text/javascript"></script>

There's no error in the console. The contents of transactions/index.js are correct:

Paloma.callbacks['transactions/index'] = function(params){
alert('Index!');
};

transactions/_callbacks.js is empty... I guess there's something to do with that... maybe :/

problem using paloma and capybara

I tried to use the gem and I am quite happy with its functionality.
However all my cucumber scenarios with checks for a page contents are now failing with:

Capybara::Ambiguous: Ambiguous match, found 2 elements matching xpath "/html"

The problem is in the fact that paloma writes its <div> after closing </html>. This produces an invalid html which is displayed OK in a browser, but which breaks capybara.

I fixed this issue by patching update_callback function from action_controller_filters.rb as follows:

    def update_callback
      add_to_callbacks @__callback__, @__js_params__

      paloma_txt = view_context.render partial: 'paloma/callback_hook',
          locals: {callbacks: session[:callbacks]}
      r_ind = response_body[0].rindex('</body>')

      response_body[0] =
          response_body[0][0,r_ind] + paloma_txt + '</body></html>'.html_safe

      response.body = response_body[0]
      clear_callbacks
    end

Possible memory leak by fix of issue #40

So, I'm one more that is having issues regarding paloma and turbolinks. and just like #43 I'm using #40 proposed solution to fix the issue.

My concern is that, this is not actually fixing the issue, this could potentially lead to a memory leak or memory saturation, given that we are not unbinding the functions added to the document, we are just ignoring them.

Have you thought of any possible solution?

License missing from gemspec

RubyGems.org doesn't report a license for your gem. This is because it is not specified in the gemspec of your last release.

via e.g.

spec.license = 'MIT'
# or
spec.licenses = ['MIT', 'GPL-2']

Including a license in your gemspec is an easy way for rubygems.org and other tools to check how your gem is licensed. As you can imagine, scanning your repository for a LICENSE file or parsing the README, and then attempting to identify the license or licenses is much more difficult and more error prone. So, even for projects that already specify a license, including a license in your gemspec is a good practice. See, for example, how rubygems.org uses the gemspec to display the rails gem license.

There is even a License Finder gem to help companies/individuals ensure all gems they use meet their licensing needs. This tool depends on license information being available in the gemspec. This is an important enough issue that even Bundler now generates gems with a default 'MIT' license.

I hope you'll consider specifying a license in your gemspec. If not, please just close the issue with a nice message. In either case, I'll follow up. Thanks for your time!

Appendix:

If you need help choosing a license (sorry, I haven't checked your readme or looked for a license file), GitHub has created a license picker tool. Code without a license specified defaults to 'All rights reserved'-- denying others all rights to use of the code.
Here's a list of the license names I've found and their frequencies

p.s. In case you're wondering how I found you and why I made this issue, it's because I'm collecting stats on gems (I was originally looking for download data) and decided to collect license metadata,too, and make issues for gemspecs not specifying a license as a public service :). See the previous link or my blog post about this project for more information.

controller not called when using link_to and jqm

Hello,

I'm using jquery ui mobile in my ruby on rails application. (I'm new to both, so this could just be a result of my mistake). I have an index page, that acts as home page. It links to the "identities" page where i pull data from model, and display is in a d3.js chart. I'm using paloma as the bridge between the two...

When i go to the identities page from the index page, the paloma controller for the identities page does not get called.
But, when i refresh the identities page, the controller gets called.

Am I missing something?

Thanks,
Madhu

paloma_issue_1
paloma_issue_2
paloma_issue_3

CoffeeScript setup :(

Really great job with the Gem!

Would love to see a coffee-script setup though, especially as rails defaults to using coffee-script.

Thanks

update_callback throws exceptions on header-only responses

The following code in our controller should cause Rails to generate a header-only response with HTTP status code 200 and no content:

class EmployeesController < ActionController::Base

  def update
    respond_to do |format|
      format.any do
        head :ok
      end
    end
  end

end

With Paloma installed, a PUT request to this action instead results in the following exception:

Missing partial paloma/callback_hook with {:locale=>[:en], :formats=>[:all], :handlers=>[:erb, :builder, :slim, :coffee, :haml, :rabl]}.
Searched in: * "/Users/<username>/Development/<app name>/app/views" * "/Users/<username>/.rvm/gems/ruby-1.9.3-p194/gems/jasminerice-0.0.10/app/views" * "/Users/<username>/.rvm/gems/ruby-1.9.3-p194/gems/paloma-2.0.1/app/views" * "/Users/<username>/.rvm/gems/ruby-1.9.3-p194/gems/kaminari-0.14.1/app/views" * "/Users/<username>/.rvm/gems/ruby-1.9.3-p194/gems/devise-2.2.3/app/views" * "/Users/<username>/.rvm/gems/ruby-1.9.3-p194/gems/paloma-2.0.1/app/views"
Backtrace:
  /Users/<username>/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.12/lib/action_view/path_set.rb:58:in `find'
  /Users/<username>/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.12/lib/action_view/lookup_context.rb:109:in `find'
  /Users/<username>/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.12/lib/action_view/renderer/partial_renderer.rb:339:in `find_template'
  /Users/<username>/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.12/lib/action_view/renderer/partial_renderer.rb:333:in `find_partial'
  /Users/<username>/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.12/lib/action_view/renderer/partial_renderer.rb:222:in `render'
  /Users/<username>/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.12/lib/action_view/renderer/renderer.rb:41:in `render_partial'
  /Users/<username>/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.12/lib/action_view/renderer/renderer.rb:15:in `render'
  /Users/<username>/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.12/lib/action_view/helpers/rendering_helper.rb:24:in `render'
  /Users/<username>/.rvm/gems/ruby-1.9.3-p194/gems/haml-4.0.0/lib/haml/helpers/action_view_mods.rb:12:in `render_with_haml'
  /Users/<username>/.rvm/gems/ruby-1.9.3-p194/gems/paloma-2.0.1/lib/paloma/action_controller_filters.rb:23:in `update_callback'
  ...
  (further lines snipped)

I have confirmed that the _callback_hook.html.erb file is present and readable at the path where it is searching. But no views or templates should be necessary for a header-only response. Checking the relevant line of lib/paloma/action_controller_filters.rb shows that Paloma's update_callback method is calling view_context.render( :partial => "paloma/callback_hook" ) even though this is a header-only response. I would instead expect it to detect header-only responses and skip rendering entirely.

I will admit to being something of a Rails newbie, so if there is something that I'm forgetting to do that would make this work, I apologize in advance and just let me know.

Is there a way to add Paloma javascript hook selectively?

Hey,

I'm going to need Paloma only on some of my pages. But it seems it's still adding the javascript hook to every page where it's basically useless.

Is there a way to tell Paloma to add the javascript hook only to certain pages and not add it only all others by default?

Thanks. Great gem btw.

Flash and redirect_to

Redirects of the form below do not seem to be setting the appropriate flash variables with the Paloma gem included.

redirect_to root_path, alert: 'Error: this does not get set in the flash hash'

Paloma not responding to controller #create action using jQuery UJS and `form_for`

I am not able to figure out how to get Paloma working in Rails 4 using jQuery UJS AJAX with :format => :html controller responses. Since rendering .js.erb files is perhaps the more common approach, the documentation is really thin in this area. I have documented my approach to using Paloma in AJAX responses with link_to tags in the Wiki, and will add more docs on using Paloma with form_for if I can get this solved.

I have three actions in my Songs controller, and #show is working fine:

class SongsController < ApplicationController

  def show
    @song = Song.find(params[:id])

    js "Songs#show",
      :song_rating_score => @song_rating.score, 
      :song_rating_id => @song_rating.id,
      :song_average_rating => @song.average_rating

    respond_with @song do |format|
      format.html
    end
  end

  def new
    @song = Song.new
    js false
  end

  def create

    @song = Song.new(song_params)
    js "Songs#create"

    if @song.save
      flash[:notice] = "Song saved!"
      redirect_to song_url(@song), :status => 201, :format => :html
    else
      render :action => "new"
    end
  end

  private
    def song_params
      params.require(:song).permit(:song_name, :song_author, :song_album, :search)
    end
end

My form_for tag is as follows:

= form_for(@song, html: { class: 'fields-form add_song_form' }, :remote => true, :format => :html) do |f|
  = render "shared/error_messages", object: f.object
  = render :partial => "form", :locals => { :f => f }
  .actions
    = f.submit "Add This Song", class: ""

And generates this HTML:

<form accept-charset="UTF-8" action="/songs.html" class="fields-form add_song_form" data-remote="true" id="new_song" method="post">

When I click submit, the server logs show that everything has worked just like it should:

[INFO] Started POST "/songs.html" for 127.0.0.1 at 2014-07-23 10:49:08 -0700
[INFO] Processing by SongsController#create as HTML
[INFO]   Parameters: {"utf8"=>"โœ“", "song"=>{"song_name"=>"asdfadsfasd", "song_author"=>"adfasdfasdf", "song_album"=>"asdfasdfasdfasdf"}, "commit"=>"Add This Song"}
[DEBUG]   User Load (0.5ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 25 ORDER BY "users"."id" ASC LIMIT 1
[DEBUG]    (0.1ms)  BEGIN
[DEBUG]   SQL (0.5ms)  INSERT INTO "songs" ("created_at", "song_album", "song_author", "song_name", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"  [["created_at", Wed, 23 Jul 2014 17:49:08 UTC +00:00], ["song_album", "asdfasdfasdfasdf"], ["song_author", "adfasdfasdf"], ["song_name", "asdfadsfasd"], ["updated_at", Wed, 23 Jul 2014 17:49:08 UTC +00:00]]
[DEBUG]    (0.4ms)  COMMIT
[INFO] Redirected to http://localhost:3000/songs/99
[INFO]   Rendered .../paloma/_hook.html.erb (0.3ms)
[INFO] Completed 201 Created in 44ms (ActiveRecord: 1.6ms)

The Paloma _hook is called and everything...

If javascript is turned off in the browser, the controller action works as expected. With javascript turned on, the new Song is saved, but otherwise nothing happens in the browser. When I try to handle the UJS AJAX events in Paloma to code the view responses, the Paloma controller never runs:

// app/assets/javascripts/paloma/songs.js

var SongsController = Paloma.controller('Songs');

// this controller runs
SongsController.prototype.show = function(){

  alert("on Songs#show this alerts and logs the following to the console:");
  // [Log] Paloma: Execute Songs#show with (init.js, line 15)

};

// but this one doesn't
SongsController.prototype.create = function(){

  alert("this alert never runs..");

  // here I try to do AJAX stuff with UJS response, but it doesn't work
  $('.add_song_form').on('ajax:success', function(event, data, xhr, status) {
    // first stab at a redirect
    data = $.parseJSON(data);
    if (data.location) {
      window.location.href = data.location;
    }
  });
};

Not being able to respond using any of the usual .js formats (:json, :js, etc.) is definitely replacing Rails' conventions with Paloma's conventions. I think these conventions need to be documented, with a full description of how to use Paloma with a form_for tag and jQuery UJS. If I can get this working I will put a short explanation up in the Wiki! Thanks in advance for the help.

render :json doesn't work after including Paloma in my project

I get a AbstractController::DoubleRenderError on the line render :json => {"status" => "OK"} (I commented out everything else in the action). Also, I tried to render and return, but I'm getting the same error. Used Paloma 3.0, Paloma 4.1.0 and Paloma 4.1.1.

Getting internal gem code exceptions

Getting following exception in some of the calls

undefined method empty?' for nil:NilClass paloma (3.0.2) lib/paloma/action_controller_extension.rb:56:inappend_paloma_hook'

Thanks

couldn't find file 'paloma_core.js'

I'm getting "couldn't find file 'paloma_core.js'"

I've added "//= require paloma" into my application.js file
I've run the rails g paloma:setup

jstree error

Hi,

It seems that Paloma making jstree not working properly:

source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.4'

# Use sqlite3 as the database for Active Record
gem 'sqlite3'

# Use postgresql as the database production for Active Record
gem 'pg'

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.2'

# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'

# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'

# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use unicorn as the app server
gem 'unicorn'

# Use Capistrano for deployment
gem 'capistrano', group: :development
gem 'capistrano-rvm'
gem 'capistrano-bundler'
gem 'capistrano-rails'
gem 'capistrano-nginx-unicorn', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]

# Use Spree Commerce
gem 'spree', github: 'spree/spree', branch: '2-3-stable'
gem 'spree_gateway', :git => 'https://github.com/spree/spree_gateway.git', :branch => '2-3-stable'
gem 'spree_auth_devise', :git => 'https://github.com/spree/spree_auth_devise.git', :branch => '2-3-stable'
gem 'spree_i18n', :github => 'spree/spree_i18n', :branch => '2-3-stable'

# RSpec
group :development, :test do
  gem 'rspec-rails'
end

# Analytics
gem 'analytics-ruby', :require => 'segment/analytics'

# Interact between Ruby and JavaScript
gem 'paloma'

Here the error:

GET http://localhost:3000/api/taxonomies/1/jstree 500 (Internal Server Error) jquery.js?body=1:9667
  send jquery.js?body=1:9667
  jQuery.extend.ajax jquery.js?body=1:9212
  root.setup_taxonomy_tree taxonomy.js?body=1:102
  ...

When I remove Paloma, is working well, when I get it again, error 500.

In the meantime I'll have to remove it and find another way to write "clean" JavaScript.

Paloma 4 executing multiple controller actions with turbolinks

I think this is vaguely related to issue #40. I tried fmbiete's solution but it didn't work because what seems to be happening isn't mulitple fires but compounded loading.

I created some js into a #new action and it works fine for that action. However, when I then go back to the #index action on the same controller, or even a different controller, the js for the #new action of the first controller, which is loaded by turbolinks, also executes.

I'm using Rails 4.0.3

I was looking forward to using Paloma 4 because I'm getting burned by the 4k session limit.

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.