Ruby on Rails is an open-source web development framework optimized for programmer happiness and maintaining sustainable productivity. Many things are defined by convention, freeing you from having to re-invent things to stay productive.
-5
votes
0answers
29 views
Trying to make users able to tag other users photos [on hold]
I have a Rails app which has a photo tagging feature. Users are able to tag their photos with items.
Basically I want other users to be able to "suggest tags" into other users photos.
Then, the user ...
1
vote
1answer
55 views
Should I be writing feature or request specs?
I've been writing model specs for a while now and I'm gradually moving towards integration testing. Right now, I'm looking at the best way to test the output of my ActiveAdmin dashboard but I'm unsure ...
-1
votes
0answers
33 views
Most common use cases for task runners [closed]
Often I see company job descriptions list task runners as a preferred skillset. Some of the companies that list this are sometimes seen using a framework like Rails which has its own asset pipeline, ...
-3
votes
0answers
26 views
Regex for a string [closed]
I have the below string:
"\n - MyLibrary1 (= 0.10.0)\n - AFNetworking (= 1.1.0)\n - MyLibrary2 (= 3.0.0)\n - Objective-C-HMTL-Parser (= 0.0.1)\n\n"
I want to create a JSON like this:
{
...
0
votes
1answer
54 views
Should I use expect or should when writing RSpec specs? [closed]
Please can someone explain to me how I should go about deciding whether to use expect or should syntax for my rspec examples.
From my understanding we should no longer be using the 'should' syntax.
...
1
vote
2answers
97 views
Architecture to handle service concurrency on resources exposed via REST API [on hold]
REST API frameworks like Python Eve handle concurrency control via an entity tag. This ensures that several clients which loaded the same resource will not overwrite the changes of each other, because ...
0
votes
1answer
46 views
Calculate which quantity packages to use based on quantity of bookings
In my app, many appointments can be booked for activities. Each activity has many price packages with a price and a quantity.
On showing the cart, I need to work out what combination of packages ...
0
votes
1answer
27 views
Ruby on Rails application interfacing with a Datamax barcode printer [closed]
I am trying to find a standalone way to interface with a Datamax M-Class Mark2 label printer through a Ruby on Rails application. I currently have a solution that is working, which i use javascript to ...
1
vote
0answers
40 views
Ruby on Rails - Belongs_to and Active Admin not creating foreign ID
I have the following setup:
class Category < ActiveRecord::Base
has_many :products
end
class Product < ActiveRecord::Base
belongs_to :category
has_attached_file :photo, ...
0
votes
0answers
17 views
An efficient + extendable way to store/reference a normalized set of “causations”?
I'm looking for a good way to define and store references to a normalized set of "causations". I have a well-defined set of reasons (short, descriptive strings) why certain objects are created and ...
0
votes
0answers
56 views
Splitting up a Rails/Ruby app onto multiple servers
We recently moved a large application to two machines, both running the same codebase.
I. Machine A
Web server for public facing application
Receives web hook call backs from our ESP
Handles a ...
0
votes
1answer
23 views
A container only assets in Rails
I have multiple segmented Rails apps that are connected to each other:
App A
App B
App C
While I try to keep the design, such as header and footer, to look similar, but each app has its own ...
1
vote
1answer
137 views
How can I estimate hosting costs on Heroku into the hundreds of thousands of users?
Heroku's pricing page is clear when looking at what I'm paying and what I'm getting, but it is not helpful for predicting future costs of an app. If I have an app that is still being developed, how ...
0
votes
1answer
66 views
Refactoring a Single Rails Model with large methods & long join queries trying to do everything
I have a working Ruby on Rails Model that I suspect is inefficient, hard to maintain, and full of unnecessary SQL join queries. I want to optimize and refactor this Model (Quiz.rb) to comply with ...
1
vote
1answer
79 views
Rails Google Cloud Messaging with heroku
I'm looking at using GCM to send notifications from my rails app to an Android app. The getting started guide says:
In the resulting configuration dialog, supply your server's IP address.
I'm using ...
-1
votes
1answer
68 views
Web app that runs other applications? [closed]
I am trying to write a web application that interacts with a service that would run scripts at the system level. Something like a website that you can schedule a job, the service will run the job with ...
2
votes
0answers
54 views
Do Rails Join Models Get Controllers?
I have a rails app where my users can buddy up with other users. Since that relationship can have a status (approved/rejected/pending), I decided to go with a join model (UserRelationship) so now I ...
-1
votes
2answers
50 views
Embedded Model Designing — top down or bottom up? [closed]
I am trying to learn RoR and develop a webapp.
I have a few models I have thought of for this app, and they are fairly embedded. For example (please excuse my lack of RoR syntax):
Model: textbook
...
1
vote
1answer
53 views
How to Structure a Trinary state in DB and Application
How should I structure, in the DB especially, but also in the application, a trinary state?
For instance, I have user feedback records which need to be reviewed before they are presented to the ...
1
vote
1answer
66 views
Where does Rails get it's datetime for creating records?
I have a rails app with a data model called 'jobs' and i'm faced with a critical design choice crossroads.
I don't know enough about Rails and it's inner workings to be able to say for sure what I ...
1
vote
0answers
66 views
Serialized values or separate table, which is more efficient?
I have a Rails model email_condition_string with a word column in it. Now I have another model called request_creation_email_config with the following columns
admin_filter_group:references
...
2
votes
2answers
154 views
Is is OK to use a non-primary key as the id in a rails resource?
I am getting ready to set up a resource for some new api calls to my rails application.
I am planning on calling the resource devices ie
resources :devices
This is going to represent android ...
0
votes
0answers
82 views
Ruby on Rails Development: updating model attribute using f.association collection
Im currently working on a rails program. It contains many different databases but to keep things simple I have a people, student, and faculty table.
A person can be a student or faculty member and ...
0
votes
1answer
135 views
Rails engine testing - use dummy app or real parent app?
I'm using Rails engines to break up a big app into smaller pieces. The parent app mostly handles users and authentication.
In one of my engine tests I want to log in a user before each test. How ...
0
votes
0answers
46 views
One huge rails webapp or many small webapps?
We have a huge system to develop, it has 3 main functions:
API provider
Worker to automated data retrieval
Management of data built in workers
They all share the same DB, but for scalability ...
0
votes
0answers
60 views
Ruby on Rails - branding
I am working on a website, which is to have multiple brands. The core functionality for all brands will be the same, however there will be a number of differences between them. Those differences may ...
0
votes
1answer
60 views
Change of session/context in rails application
I'm currently developing an app in Ruby on Rails with a social network side, and have several different models including users, groups and pages.
I would like to allow users to be group/page admins, ...
1
vote
2answers
226 views
Need advice on design in Ruby On Rails
For personal educational purposes I am making a site for a conference. One of the object that exist in a conference is a session, which has different states and in each state it has slightly different ...
0
votes
0answers
56 views
Extracting models into a external dependency
About 9 months ago, I asked a question about creating a service layer for my application. Unfortunately, in the ensuing time, no progress in that area was made, primarily due to time constraints. As ...
0
votes
1answer
204 views
Create a loop that visits every link on a site [closed]
I want to create an HTML scraper in Ruby on Rails and I want to implement a progress bar and an ability for it to pick up where it left off if it's interrupted while scraping.
I think the best way to ...
1
vote
3answers
242 views
Why does Rails do config in code?
According to the Pragmatic Programmers, code should be for abstractions, while configuration and details should live in metadata. Rails seems to diverge dramatically from this pattern. Much config is ...
1
vote
1answer
201 views
Should an object update itself?
I'm working on Ruby on Rails. There is a feature in our app where doctors can "claim" cases for themselves.
I can either have the doctor perform the action and update the plate, or I can have the ...
-2
votes
1answer
3k views
Advantages and disadvantages of PHP/Ruby [closed]
I've been a front-end developer for about two years now, and I'm attempting to break into the server side of things. Ideally I'd like to work for a startup social network on the back-end side so I ...
1
vote
0answers
69 views
Rails: get data about a model collection, with new model or method?
have a model Product with attributes sales, views and I need to get sales/views count of all products, in this case is more correct to implement this things as method and have a call like ...
3
votes
1answer
861 views
Ruby on Rails database using static lookup tables or constant strings
In some ruby on rails projects, I have seen instances where strings are used instead of a foreign key reference to a lookup table.
I usually code in C#/SQL Server and use lookup tables, but am not ...
1
vote
1answer
182 views
Dealing with 'dirty' Ruby on Rails client
I had to leave a startup about a month ago because of lack of funding. Basically, this client wanted an application to allow contractors to create, update, read, and delete yardsigns. Straight forward ...
0
votes
1answer
227 views
Is api user authentication with oauth possible for both email/pw and 3rd party services
I have an api only application (rails-api) and I'm looking to authorize a user on both email/password or 3rd party services like facebook or twitter etc, so I know I will have to use Oauth at some ...
2
votes
1answer
125 views
How to create html pages which don't change very much and not very often?
I have a Rails server that connects to a json API on another server to get data to build the pages dynamically. These pages, however, don't change very much and not very often.
I was thinking I could ...
1
vote
2answers
408 views
What is the best way to build a static page web site from a JSON API?
I have a JSON API that includes some discusssions. I want to build a static html site on another server, pages that are built from data on that API. I am more comfortable using Rails than Node. The ...
1
vote
1answer
82 views
Should I use the new method/action to retrieve records? (Rails)
I have an admin controller that is just used for its index action which renders a view with the most recent updates to certain resources:
class AdminController < ApplicationController
...
0
votes
2answers
228 views
help me understand Rails and attributes as class methods
This is from the Hartl Rails tutorial. We are automatically logging in a user in the process of creating that user with a callback to #create_remember_token. It works great but there are some things, ...
0
votes
1answer
337 views
Multiple roles in Ruby On Rails
I've been asked to put together an application in RoR which has multiple roles for users. The idea is that a user will have a role, Admin, Moderator, User ect... and they will also have a department ...
0
votes
1answer
260 views
model association or controller?
I'm trying to create a rails app that allows users to submit information about their pets. I've come to a point where my knowledge is limited and I don't know enough about what/how this could be done ...
0
votes
1answer
139 views
Refactoring this code that produces a reverse-lookup hash from another hash
This code is based on the idea of a Form Object
http://blog.codeclimate.com/blog/2012/10/17/7-ways-to-decompose-fat-activerecord-models/
(see #3 if unfamiliar with the concept).
My actual code in ...
1
vote
1answer
204 views
How to build an API on top of an existing Rails app with NodeJs and what architecture to use? [closed]
The explanation
I was recently hired by a company that has an old RoR 2.3 application with more than 100k users, a strong SEO strategy with more than 170k indexed urls, native android and ios ...
8
votes
4answers
699 views
Rails: Law of Demeter Confusion
I am reading a book called Rails AntiPatterns and they talk about using delegation to to avoid breaking the Law of Demeter. Here is their prime example:
They believe that calling something like this ...
0
votes
0answers
19 views
Rails: The Law of Demeter [duplicate]
I am reading a book called Rails AntiPatterns and they talk about using delegation to to avoid breaking the Law of Demeter. Here is their prime example:
They believe that calling something like this ...
62
votes
16answers
6k views
How much freedom should a programmer have in choosing a language and framework?
I started working at a company that is primarily C# oriented. We have a few people who like Java and JRuby, but a majority of programmers here like C#. I was hired because I have a lot of experience ...
2
votes
1answer
328 views
Rails: Useful example of delegate and Law of Demeter
I am currently learning about delegate and the Law of Demeter. I understand the Law of Demeter, but I can't seem to find a good example of where using delegate to avoid breaking the law would actually ...
0
votes
0answers
165 views
Creating a new database with Active Record
Please tell me if this is mad, but basically, I've created a custom rake task, and before it does its thing, it gives the user a warning message:
Warning, please back up your database before ...