Ruby on Rails is an open source full-stack web application framework written in Ruby. It follows the popular MVC framework model and is known for its "convention over configuration" approach to application development.

learn more… | top users | synonyms (2) | ruby on rails jobs

0
votes
0answers
6 views

Capybara: Element Not Found

The problem I'm facing is that I can't figure out why Capybara isn't finding any elements that are in the nav. The only link it can find is "New Project". Below is the rspec test case. require ...
0
votes
0answers
11 views

Ruby on Rails - Optimize big nested objects save

My program is dealing with a deep nested object. Here is an illustration of this nested model : ParentObject HasMany ChildObject1 ~ 30 records ChildObject1 HasMany ChildObject2 ~ 40 records ...
0
votes
0answers
4 views

Rails using paranoid and dragonfly

I have a situation where I want to soft delete some models, and hard delete others, but both models use the Photo class. I can't figure out a why to properly destroy the photo(s) based on if I am soft ...
0
votes
0answers
7 views

Bootstrap modal loads and disappears for remote action

I'm rendering a partial view in a bootstrap modal. The modal loads but immediately disappears. The rest the screen however remains dim as if the modal is still visible. I have look at the answers here ...
0
votes
0answers
3 views

Carrierwave: Saving Original Filename not working

I am using the latest Carrierwave (master branch) in Rails 4.2.1. I am needing to save the original filename (before sanitization) of the uploaded file. I found a section in Carrierwave Wiki about how ...
0
votes
0answers
4 views

why does mysql2 error 'access denied' when reconnect is false and connections are killed?

I searched several existing questions, but none had a simple answer to this particular point. I've been digging in both the mysql2 source and the mysql connector source code, but can't really find ...
0
votes
0answers
10 views

RailsTutorial Ch. 10: How do I test that only activated users are viewable to others?

Currently, my Rails app only displays activated user accounts in the search results. It also only allows people to navigate to a profile page if that profile has been activated. To do these things, ...
0
votes
0answers
13 views

Polymorphic Associations for Multiple User Roles in Rails

I'm a designer/HTML+CSS dev learning Rails, and I'm having trouble with multiple user roles. My main models are as follows: Studio has_many :locations, dependent: :destroy has_many :events, through: ...
0
votes
0answers
2 views

Issue with Payment method selection when I add Braintree Drop-in UI in Spree Store

I'm trying to implement extension to accommodate drop-in UI of braintree when customer selects Braintree as a payment method. If I add braintree js code into _gateway.html.erb then all the other ...
0
votes
0answers
18 views

Rails rspec - how to check for presence of some attributes in a model

I have start learning ruby/rails few weeks ago. I have to write test case for a model class to verify if some crucial attributes are present are not. RSpec.describe SomeModel, :type => :model do ...
0
votes
1answer
21 views

User path with username

To show User's profile I used their id. In controller: @user = User.find(params[:id]) In routes: get ':id' => 'users#show' But now I try new way with username: get ':username' => ...
1
vote
1answer
11 views

How to select items that belong to a model depending on a boolean in model

so I have a model :note that belongs to model :folder that takes a :folder_id. The :folder model takes a :privacy boolean that should determine whether the folder's notes can be seen by other users or ...
0
votes
0answers
4 views

skip_callbacks in rspec tests not working

I have a few callbacks in my User model as follow: after_update :update_one_login, unless: :skip_callbacks after_create :create_on_one_login, unless: :skip_callbacks and I want to skip these in my ...
0
votes
0answers
10 views

Masonry - Only having desired effect after browser resize

I'm a relative newb to development, and I have searched for the answer to this but can't find a solution that matches my problem. I've used a (very simple) bit of masonry to give the 'auto sizing' ...
0
votes
3answers
19 views

Javascript Changing Random Background Image Issue

I am on Rails 4, and finally got this javascript working. It changes randomly changes the background image every 10 seconds with a fadein fadeout effect. The only issue is every so often, an image ...
0
votes
0answers
5 views

Getting Foundation Icons to display in Rails 4 / Cloudfront Environment

I have managed to deploy my Rails 4 app to Heroku. All assets are served from a Cloudfront instance. This part works perfectly. The only issue I'm experiencing, is the fact that my foundation icons ...
0
votes
0answers
1 view

OmniAuth Google Oauth2 Crash when API Access Toggled by Admin

ERROR -- omniauth: (google_oauth2) Authentication failure! invalid_credentials: OAuth2::Error, {"errors"=>[{"domain"=>"plus", "reason"=>"accessDisabledByAdmin", "message"=>"The access to Google+ APIs ...
0
votes
1answer
11 views

Unable to generate new rails app - `load': cannot load such file — /home/***/.rvm/gems/ruby-2.2.0/gems/rails-4.2.0/bin/rails (LoadError)

I'm unable to run rails new SomeApp. I receive the following error: load': cannot load such file -- /home/captainawesome/.rvm/gems/ruby-2.2.0/gems/rails-4.2.0/bin/rails (LoadError) Going through ...
0
votes
1answer
8 views

Call custom action using RABL gem? Rails 4 and RABL

I have a custom action called search in my rails app that has two corresponding pages: search.html.haml search.json.rabl The form that corresponds to the search method looks like this: = ...
1
vote
1answer
19 views

Rails - Using different views for anonymous vs. logged in users: Bad idea?

My admin accounts are user accounts with a simple boolean set to true. Works fine for now, I can control functionality with if statements in the views, example: <td><% if ...
0
votes
2answers
11 views

how to get validated the associated attributes? rails4

I am using rails4. I have a model, lets say human. Human has nested model Man. Man has attributes Name, Address, Number. I am trying to make an api in which i am not able to validate associated ...
0
votes
0answers
11 views

Configuring avatar image sizes using Omniauth Facebook

Right now I'm trying to save large images for a user's avatar using Omniauth Facebook and Paperclip. It appears that after the user is created only the smallest image size is saved. I did some ...
0
votes
0answers
11 views

Wrong redirect URI using shopify-app gem

I've been trying to create an application these past few days. First I've been trying to create an app on localhost (http://localhost) but have been getting errors since Shopify is only supporting ...
0
votes
0answers
7 views

Puma - ERROR: No application configured, nothing to run

I've been able to start my Puma web server with my Rails app just fine for months now. But just now chown -R www:www * on /home/myapp/ to replace it with the old myapp:wheel, and now, I'm getting ...
0
votes
1answer
17 views

How to add JavaScript framework in rails app without adding gems?

I just want to know how to include frameworks like angularjs, polymer js, bootstrap.... Into rails app without adding corresponding gems. Reason is the gems that are available are changing and some of ...
1
vote
1answer
13 views

Controller method: Contact form should render different page depending on where the form is used

I have a contact form on a special page dedicated to this form. The dedicated controller includes: def new @message = Message.new end def create @message = Message.new(message_params) if ...
0
votes
0answers
7 views

Delay all mailers in rails/spree

Is there any way to delay all mails in spree/rails without modifying all the Mailer files? I'm talking about delaying using sidekiq. There is an extension called sidekiq_mailer but it still involves ...
0
votes
1answer
12 views

Saving to a database using a Nokogiri (json?) rake task

RoR noob here! I have a rake task doing what I want to do I am just stuck on how to get the results saved to my language table. I want the results from this rake task to populate the values of the ...
0
votes
0answers
11 views

Vacuum Gem + Heroku = Broken Rails App

I have created a super simple rails app that takes a list of amazon ASINs, creates product records for each, hits the amazon API using the item_lookup method with each ASIN, and accordingly populates ...
0
votes
1answer
29 views

Rails Javascript - Calling a javascript function from the view

I have a javascript file abc.js. I have kept it inside app/assets/javascripts/abc folder. In my application.js file, I have given //= require abc/abc In my view, I need to display the object that ...
0
votes
1answer
9 views

Error adding articles on the page

Following the example guides.rubyonrails.org/getting_started.html I receive an error undefined method `articles' for nil:NilClass in attempt of addition of article on the page. routes.rb ...
1
vote
0answers
25 views

How to simulate Request Timeout in rspec with faraday

I use Faraday gem in app, and I want to test how my app works when Faraday connection fails by timeout. How can I stub request for this case?
0
votes
0answers
28 views

Is it a good idea to host angularjs app on amazon s3?

I have a rails api app hosted on heroku. I separated FE part and made an angualrjs app so that it would be easy to use frameworks like polymer js. Now the question is where to host this FE Angularjs ...
0
votes
0answers
15 views

The correct way to version Rails 3 APIs

I have a Rails 3 engine which exposes API routes for around 20 controllers. Those controllers represent several different resources at various levels of nesting and are covered by over 500 rspec ...
0
votes
2answers
36 views

Show array as checkboxes

I have this form: <%= form_for @user, url: admin_user_path(@user.id) do |f| %> <%= f.label :first_name %> <%= f.text_field :first_name %> <br> <%= ...
0
votes
3answers
25 views

Rails 4, AJAX, js.erb, missing template

I am trying to get the idea of AJAX rendering a template into the index page. Can anyone help me understand how Rails render "next.js.erb" rather than looking for "next.html.erb"? routes.rb get ...
0
votes
2answers
27 views

Adding bootstrap to rails

I try to add bootstrap but it doesn't work! http://hkar.ru/BMMZ
0
votes
1answer
15 views

After switching branches, Rails throws undefined method inside of a helper module

Not sure if I could reliably reproduce this, but sometimes when I switch branches in development all requests start throwing an undefined method error inside of a helper. The method is present on both ...
0
votes
1answer
9 views

Installing refills gem gives error

I am trying to install a gem refills for my rails application. This is what i get when i run gem install refills -v '0.1.0' ERROR: Error installing refills: invalid gem: package is corrupt, ...
0
votes
0answers
6 views

ActiveAdmin with CKeditor: AA Javascript not working

After adding ckeditor gem to my ActiveAdmin, my AA JS is not working anymore, without throwing any errors. Basically, when I click on a button that used to add additional categories to a model, for ...
0
votes
0answers
12 views

Take Hstore Column and write scopes and get all values populate select for each

I'm using store to avoid single table inheritance. Cpu belongs to Part and has many part types. Each Type of part has an hstore_accessor allowing the following key/value to be called as if it where a ...
0
votes
2answers
24 views

whenever gem not working, Rails 4

I am using Whenever gem to schedule some work on my site. Currently I am working on development environment. I have instaled gem as guide suggests. In schedule.rb every 2.minutes do rake ...
2
votes
1answer
20 views

Form with select and numbers ruby on rails

I need to create a order scaffold that let me know the needs of our clients in a list of products and the units they want to order. I wouldn't like to create one order for every product, i would like ...
0
votes
1answer
9 views

Rails, DNSimple, Heroku and SSL - do I need a certificate?

So I'm currently deploying my app via Heroku. I noticed that in my-app-name.herokuapp.com has HTTPS, so if I do config.force_ssl = true in my environments/production.rb it seems like I have wildcare ...
0
votes
0answers
11 views

Tag Meta-Data with Act-As-Taggable-On

I'm using Act-As-Taggable-On Gem and I'd like to build out a feature that allows for Tag_Settings on an Images Tag that's set by a User. Use case: The User sets the background colour on a Tag, when ...
1
vote
1answer
17 views

Elasticsearch advanced search

I find Elasticsearch gem and want to use it. For example I have: Method in app/controller/search_controller.rb: def search if params[:q].nil? @articles = [] else @articles = ...
0
votes
1answer
10 views

Grab host app active record objects when engine and host app have same model names

I have a host app unicorn with the model Article. I also have a mountable engine hooked into the host app called blorgh. It also has a model: Article. It is namespaced, so the table name for the ...
0
votes
2answers
20 views

Rails - adding a field to a JSON response

I need to add a field to a JSON response. def index if params[:competition_level] @competition_level_id = params[:competition_level].to_i end @matchups = @weekly_scoreboards # ...
0
votes
0answers
14 views

Unable to get passenger/rails to run in production mode

Setting up Nginx/Passenger/Rails stack on a new server. For some reason it just won't run in production environment. running rails r "puts Rails.env" from the app root directory keeps giving me ...
0
votes
1answer
11 views

adding form_for in Model dialog box rails

I have home controller and email controller. In home controller I have a model dialog box to update the field in email tabel. So I have created a method in home controller to create new field of ...