Tag: ajax

Javascript acts_as_votable gem

Ok so I’m using the acts_as_votable gem to allow users to add/remove books from a collection. I would like for the add/remove buttons to work without reloading the page but cannot find anywhere implementing the button this way, just using it as a vote counter. I don’t care to count votes, just add/remove. My assumption […]

Issue with “Serve” ruby gem and Apache server

I host the same application to 2 difference serves (Serve: localhost:4000 and Apache:localhost:80): Here is the index.html source: <html> <head> <title></title> <script src=”//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js”></script> <script type=”text/javascript” language=”JavaScript”> var url = “http://shadow01.yumenetworks.com/dynamic_preroll_playlist.xml?domain=1552YmmwFStw”; var successFn = function (data) { console.log(data); }; $.get(url, successFn); </script> </head> <body> Hello </body> </html>> And then I those servers one by one, and […]

Implementing SitePoint's Infinite Scolling in rails by Ilya Bodrov-Krukowski

I am implementing, http://www.sitepoint.com/infinite-scrolling-rails-basics/, into my own project. It works when I type URL directly to browser after I have implemented it in my own project. However, it does not work if I link_to from a different page. It goes back to regular will_paginate, then I hit “reload” button on browser, it starts tp work […]

gem 'remotipart' does not show error in server rails 4

I am using this in my gemfile: gem ‘remotipart’ defined in my form view new.html.erb <%=form_for @user, remote: true, html: { multipart: true, class: ‘user-form’ } do |f| %> <div id=’file_browse’> <%= f.file_field :image, :id => ‘file_browse’ %> </div> <div class=”actions”> <%= f.submit %> </div> <%end%> Controller method : def create respond_to do |format| if […]

Kaminari Ajax paginate doesn't work

I have below view and controller. Though remote: true is mentioned, kaminari calls my method using http(using page refresh). Is there anything i am missing to make my kaminari links ajaxable. In VIEWS: <div id=”paginate”> <%= paginate @user, params: {slug: nil, pgsz: 20}, remote: true %> </div> In Controller: @user = Kaminari.paginate_array(@properties, total_count: @search_result.total_count).page(params[:page]).per(params[:pgsz] ||= […]

Login modal using default rails ajax request not working with subdomains

I am having a devise user model. To login I am using twitter-bootstrap modal.The modal is by default hidden and shown only after an rails default ajax request is send to the server. It works fine with localhost and production. But when a user is on a subdomain(using acts_as_tenant) like business.lvh.me:3000 the modal window does […]

How do I update a record using ajax with editable text? (Rails 4)

I would like to make some text within a table editable to get a similar result as best_in_place. However I’m not sure if this is the best gem/solution to suit my needs. If I’m not mistake this would require a form for each table row.. which could get very ugly. Is there a solution/gem that […]

Adding Sign In/Sign Up into rails app

I am trying to integrate SignIn / SignUp into my rails application. Currently i have Two API’s for Sign In and Sign Up (Maintained by other team). These API’s will take care of validations and stuff at their end and send me success/failure response back. I am aware that we can have a custom SignIn/SignUp […]

Filterrific gem is not refreshing or filtering my table as expected

I am a relative novice with rails and I am trying to use the filterrific gem for some filtering. Basically I have the index page that shows a list of vendors and I want to be able to use the filtering to actively filter/sort the records. I was able to get through the tutorial and […]

Live text chat box in rails?

Sorry if this comes across as a stupid question. Take a look at https://btc-e.com/ I’m trying to implement a live text chat box that logged in users can type into and everyone sees their message. They would be authenticated through devise. Is there any gem that can help with this. How would someone with little […]

Ruby is the best programming language in the world - Ruby on Rails.