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
4 views

Get all the elements that match a regex with nokogiri

I want to get all the elements that their text is match this regex ($[0-9].[0-9]) how can i do it ? Thanks you all
0
votes
0answers
5 views

Rails 5 will not render post made from javascript

I am using fullcalendar as the primary interface to an app that handles appointments. Should be simple, right? When I click on a particular day, I trigger ajax code that posts a simple request to ...
0
votes
0answers
9 views

rails updating a user's record by their email

I have an app with an account model and an account manager (user). I would like the account manager to be able to add other users to the account by typing in their email. The account id of the ...
0
votes
0answers
5 views

2 kind of user Rails with Devise

This is really a noob question but I've search a lot and didn't find nothing for my solution. A have a application with 2 kind of user. Customer and Contractor. I try with devise to build both and ...
0
votes
0answers
5 views

Incorrect Rails' routes when deploying as a sub-URL with Passenger

I have a Rails app deployed as a sub-URL (/fiitt) using the following directives in our Apache config file: <IfModule mod_alias.c> Alias /fiitt /Users/pjkrause/www/FIITT/public ...
0
votes
0answers
3 views

redirect user to specific route when signing up via Google/Facebook Omniauth

I want to redirect the user to a specific page upon signing up for the first time via Google or Facebook: def google_oauth2 @user = User.from_omniauth(request.env["omniauth.auth"]) if ...
-2
votes
0answers
7 views

i try to work in my mobile application to add a scrolling but not working my index.mobile

i try to work in my mobile application to add a scrolling but not working my index.mobile ` <%= render @articles %> <%= will_paginate @articles %>` my javascript code and it inside ...
1
vote
2answers
11 views

Cannot use heroku run rake db:migrate in rails?

sahilrd07:~/workspace/sample2 (filling-in-layout) $ heroku run rake db:drop Running rake db:drop on limitless-coast-42827... up, run.4760 rake aborted! NameError: uninitialized constant Sass::Script ...
1
vote
0answers
19 views

Why is Rails to_json giving a different result than Ruby to_json?

I have a Ruby script that converts a hash to json and writes it into a file. I use the to_json method. In the file, I get the following result: {"name":"Bob","age":42} I copied this script in a ...
0
votes
0answers
7 views

Can ansible be used to run ruby/rails console queries on multiple servers

Can ansible be used to run ruby/rails console queries on multiple servers. Is there any other tool which can serve this purpose. Developer run lot of console queries to get information from different ...
0
votes
2answers
6 views

Suplying different names for submit buttons in forms

I have one template for all forms in the app, however, I want to define different names for forms' submit buttons in different actions (for example, when I'm editing an article I want from submit ...
0
votes
0answers
7 views

Rails custom generators replacing an argument by a variable

When using the Ruby on Rails scaffold generator, instead of passing in an array of field names and field types, I want to set the attributes by passing in a static array. So instead of doing this: ...
0
votes
1answer
9 views

How do I create a Mailer?

Can somebody please explain me step by step how to create a rails mailer? I need an email to be sent from Hall#show page to the owner of the Hall.
0
votes
1answer
7 views

Devise model with CRUD

Problem: when I create.save guest, error appears ActionController::UnknownFormat in GuestsController#create, through the record is saved. Any Ideas how to get rid of it? I have: rails g devise ...
0
votes
0answers
7 views

What's a good Rails CMS engine for customization of existing app views?

I have this project almost finished using Rails 4, Bootstrap 3 and Devise, but there's many content the client will need to change/update, so I'm in need of a lightweight non-instrusive CMS to co-work ...
0
votes
0answers
5 views

RoR, Chartkick, bar chart with all users and number of endorsements for each

I want to create a bar chart listing all users and number of their endorsements. Would be nice to also have a drilldown on each number to display the number of endorsements the user got for each month ...
0
votes
0answers
14 views

How to bind a calculated value to ng-model field in Angular.js so that I can save the full form details in database using Ruby on Rails

I am new to Angular.JS and don't know how to communicate between Rails and Angular.js. I am creating a form for generating invoices and storing them in database. I am able to store some user entered ...
0
votes
1answer
20 views

Unable to write validations for dates in Rails

I'm trying to validate the dates in my Rails app. I'm using jQuery Datepicker to choose starting and ending date for booking in a library. I want to check before creating new reservation, that there ...
0
votes
0answers
7 views

Rails: Error installing Bcrypt using Capistrano

I'm running Ruby 2.3.0 and wish to deploy my Rails app to Ubuntu 14 using Capistrano 3. When executing cap production deploy I get the following error message: SSHKit::Runner::ExecuteError: ...
0
votes
0answers
6 views

Rails ajax validation errors for attached files

I'm having problems getting my validation errors to display when I submit my form through ajax. But only when there's a validation error for an attachment. upload.rb class Upload < ...
0
votes
0answers
13 views

Get all posts both directly and indirectly belonging to user

I have a post model that either can belong to an organization, a team or directly to a user. A user belongs to an organization and a Team, both of each has posts that the user should have access to. ...
0
votes
0answers
3 views

Adding BOM to Rails CSV with comma gem

I am using the comma gem for Rails and I am trying to find out how to make it generate a CSV file that opens directly in Excel without the need to "Open with Encoding". Since my CSVs contains UTF-8 ...
0
votes
0answers
9 views

Rails: complaining of PG::ForeignKeyViolation: despite existing dependent_destroy

I have read all literature available on the Internet and in the Library of the Congress concerning this, but no change: The article_id is in the Pictures table, as it has to be, because each article ...
0
votes
1answer
13 views

reference an image in rails from style tag

How can I reference an image in rails erb file which is in inside the style tag? <div class="item" style="background-image: url(images/slider/bg2.jpg)"> The above url will work in the html ...
0
votes
2answers
15 views

Rails how to compare column value with sum of values in associated model

I have a model project and payment class Project < ActiveRecord::Base has_many :payments, :dependent => :destroy end class Payment < ActiveRecord::Base belongs_to :project end I am ...
3
votes
0answers
23 views

Difference between application.haml and application.html.haml?

Since many days I tried to understand why a simple link like this one : link_to 'My Link', my_path(format: :js), remote: true was always returning full HTML document instead of executing javascript ...
0
votes
1answer
12 views

Dynamic change grouped_collection_select in edit form

The app has a categories, categories have subcategory and brands. When user сhoose category, load categorie brands and subcategory. In create form all worck good. _form.html.slimm = form_for @advert ...
0
votes
1answer
11 views

Rails ajax call not converting erb elements to html

There's probably a much better title for this, but I don't what the technical terms would be Anyway, I'm performing an ajax call that appends a link to a div. The link contains erb code such as ...
0
votes
1answer
13 views

How can I force a bundle install on Openshift?

So how exactly does one commit .openshift/markers/force_clean_build to force a clean bundle? As per results from git push below... remote: NOTE: You can commit .openshift/markers/force_clean_build ...
1
vote
1answer
24 views

Why is session not vanishing when the browser window is closed?

As mentioned in chapter 8 of Ruby on Rails Guide by Michael Hartl a session gets deleted when the browser window is closed. I have tried using both Chrome and Firefox but the session does not gets ...
0
votes
0answers
6 views

Rails 4 / Koala: how to refresh long access token?

Using Rails 4 and Koala gem version 2. I have my personal Facebook page (not profile). When I am publishing a new post in my website I want to automatically publish it on my facebook page as well. I ...
0
votes
1answer
9 views

Rails - Elasticsearch (Bonsai) with Heroku - Performance Issues

I am using Elasticsearch - Bonsai in one of my Ruby on Rails Project. So, far things were going very smooth. But, the moment we launched this application to end-users and people started coming-in, we ...
0
votes
0answers
7 views

How to add and show stored .doc file in generated pdf + Rails

I have a table which is store some .doc files i also have a show page which is showing student info. I want to download that show page as a pdf with stored .doc file data. Normal download working ...
-1
votes
1answer
18 views

Rails - Calculate hours on multiple records of each day

I have time records submitted on every work day of the week. I need to calculate overtime done on a particular day. If timesheet hours are greater than 8 then add to the collective timesheet overtime ...
1
vote
1answer
13 views

Rails: How to look for project time expiration?

I have a project which has set end (datetime). After this time is reached I want to disable some buttons on a project page and show it is finished. My idea is to add a boolean flag finished and change ...
0
votes
2answers
16 views

Fields parameters with hyphen in Ruby on Rails

Rails adopt camelcase or underscore naming convention and this is given. But what if the data that is to be stored in a Rails app has different naming conventions? For example an 3rd party API may ...
1
vote
1answer
16 views

Error - ForbiddenAttributesError Ruby on Rails 4 Passing through API

I am a .NET developer and currently working on ROR. As a started facing few difficulties. I hope you can help me. A ruby webapi put request is made for updating participant data in MongoDB. I am ...
0
votes
2answers
17 views

Devise undefined method `build' for nil:NilClass

I am currently enrolled in a online course in ruby on rails and im learning everything from scratch so pardon me if Im not clear in my questions. Here is my delima, I am trying to create a LINK ...
0
votes
0answers
7 views

Getting “Aborted because 0 is not accepted” and full page reload with react-hot-loader

I am trying to set up webpack hot reloading with react-hot-loader. It mostly seems to be working. I am using webpack in an existing rails app. But it isn't hot-reloading. It is simply triggering a ...
0
votes
2answers
15 views

simple rails search form not working

I have a very simple, typical search form in rails. Input a string, and it checks a column for that model if any strings match it. A few weeks ago it was working just fine. I came back today, and ...
-1
votes
0answers
7 views

ejabberd server with ruby on rails

We are developing a web application and we want to add chatting facility in our site. We are working on ruby on rails and found the xmpp4r gem that deals to create, update, delete users in ejabberd ...
0
votes
0answers
8 views

Bootstrap-social button doesn't work on Heroku

I'm using boostrap-social buttons in my Rails app. It works perfectly fine locally, but in production, on Heroku, button is displayed without Twitter icon. What can be the issue?
0
votes
0answers
13 views

Sass::SyntaxError: Invalid CSS after “…-ratio: 2) and ”: expected media expression (e.g. (min-device-width: 800px))

I am getting Sass error while assets precompile on production. rake aborted! Sass::SyntaxError: Invalid CSS after "...-ratio: 2) and ": expected media expression (e.g. (min-device-width: 800px)), was ...
0
votes
1answer
10 views

Ruby on Rails Select2 form not returning params ?

I am having trouble getting the params output from the following form. I am using Select2 and collection_select to create a text auto-complete drop dropdown, that populated items to be selected from a ...
1
vote
1answer
15 views

Render Form partial from Ajax in rails

I have a form as image below: Then I want to render this partial from ajax call: from .js.erb. But I don't know how to pass object to f from partial. See the image below: how can I pass object to ...
0
votes
1answer
10 views

Scale and fill background image

I am facing the problem for scaling and filling the background image in polygon over the image, using the server side code. (ROR, php)
0
votes
2answers
26 views

Change the column in table in ruby on rails

I have a migration file called [timestamp]_create_posts.rb. I found that I made the column with a wrong data type. I need to make t.text :content instead of t.string :content. I include the code from ...
0
votes
0answers
20 views

How to debug where this is coming from

I am getting this once in a while... I want to debug where this is coming from (what HTTP url it is activated from) - how can I? My app is grape mounted on Rails. Thanks! ...
0
votes
0answers
12 views

Keep select option group displayed if group title search in range?

I hope my question makes sense - wasn't sure on the best way to describe this. I have a grouped Select2 select form input something like this: Vegetables Lettuce Tomatoes Onions Fruit Apples ...
0
votes
1answer
16 views

Active model serializer 0.9.4 stack too deep error

Hi the serailizer in my application looks like this class ProgressSerializer < ActiveModel::Serializer attributes :id has_one :race end class RaceSerializer < ActiveModel::Serializer ...