Rails Ruby on Rails Forum

Rails Console

2
Rails
Hi all, This might be a retarded question but how do I access things other than Models in rails console, such as Controller methods, engines etc.? I wouldn't mind seeing a video dedicated to conso...
Chris Oliver replied

Number of posts on index / Posts pagination

2
Rails
I followed your forum series and it's going to work out well for me, but I couldn't figure out how to display the number of posts on the main index for each forum thread. I'd think it would hav...
Erick Sitter replied

Handle money in Rails

1
Rails
Hi, What do you think is the best way to handle money in rails? At the moment i use a decimal field with a precision if 16 and a scale of 2. the problem is that we use the comma as a decimal sign...
Chris Oliver replied

Multi Site in Rails

3
Rails
Have a Rails app which acts as a API client. Request may come from 6 different domains. Each site will have same layout. Difference between each site would be the theme color , logo and the text s...
Chris Oliver replied

filter child record by the parent.

10
Rails
Info: My models and association. I got a ServiceUser ( Manager ) model,User model, ServiceCompany model, Employee model and a Project model. A ServiceCompany can have many projects, employees and m...
Chris Oliver replied

Where to put my Big Ole' Array

5
Rails
I have an array of states and abbreviations that I check when a user is performing a search. If the items is not in the array it moves on to using a geocoded service. I do the initial check current...
shakycode replied

Single Table Inheritance: Good spot or not?

3
Rails
I have two simple models I'm about to create in an existing Rails app. One is a `NAICSCode` which has the following attributes: `company_id`, `code`, `name`, and `description`, the other is `SICCo...
shakycode replied

Add Profile page for users

3
Rails
Hello, Before i begin with my question, i would like to introduce myself. So i was introduced to ruby on rails via a friend around a couple of months back, when i decided to enroll myself with one...
shakycode replied
Solved

ActiveRecord AssociationType Mismatch

1
Rails
I have a Rails 3.2.21 app where I'm adding a simple form/collection_select field in my form. When selecting an object from the dropdown (or leaving it blank) I get the following error: ``` Active...
shakycode replied

Recurring Events

2
Rails
```ruby # Model def Event WEEKDAYS = ['sunday', 'monday', 'wednesday', 'thursday', 'friday', 'saturday'] end # Migration create_table :events do |t| t.column recurring, default: false t.co...
Chris Oliver replied

Problem with upgrading to Rails 4.2.2

9
Rails
Hi all, Hope that someone here can help. I just got an old mac back and bumped it up to OSX 10.10.3 (was on snow leopard). Did a whole reinstall for homebrew, rbenv (was rvm), ruby (2.2.2), rails...
Chris Oliver replied
Solved

Active Record Associations

2
Rails
```ruby def partner has_many :centers end def center has_and_belongs_to_many :classes belongs_to :partner end def fpclass has_and_belongs_to_many :centers end ``` - I'd like to access all ...
shakycode replied

Non Restful actions in the controller

6
Rails
I originally asked this question about building a reporting feature in my app https://gorails.com/forum/advice-on-building-a-reports-feature. I'd like to simplify this question even further. I wan...
shakycode replied

Select Form Helper Required True Not Working

3
Rails
I'm doing a very simple select field in a form which looks like this: `<%= f.select :phys_option, options_for_select([["N/A", "n/a"], ["No", "no"], ["Yes", "yes"]], :selected => @run.phys_op...
shakycode replied

How to add records to has_many :through association

5
Rails
I have three models called Site, Model and ModelSite as shown below. If i create a new model_site i can choose a site and model to save which works good but what i need help in is how can i choose ...
Wes replied

Set field on multiple records on save/change of 1 record

3
Rails
I'm working on a maintenance planning/cost application. With the help of gorails, onemonth, codeschool and all other great resources I am almost ready to launch the first release. However I can rea...
Chris Oliver replied

Flexible Nested Attributes

0
Rails
I'm working on a practice "Magazine" application, that has **Issues** with nested attributes of **Articles**, which has multiple nested attributes that are **Content Blocks**, which can be one of s...
Terence Devine posted

Simple newsletter sign up?

17
Rails
Hey Chris and all other members of this forum.... I'm trying to create a single page rails site, for a new app that i'm trying to build myself (it's called Nibli, and it's on nibliapp.com). I've ...
shakycode replied

Pundit for RESTFUL actions on Model fields

3
Rails
Hey does anyone know how to use Pundit to control a users ability to edit a field. I'd like all users to be able to change simple things like their name but I want admins to be the only one's who c...
Chris Oliver replied
Solved

JSON for Rails delegated attributes?

3
Rails
In one of my Rails apps, I have the following architecture (as part of a current refactoring): - Contact (a lot of attributes common to all people) - Prospect (specific attributes to just prosp...
Brian Schwartz replied

Learning Ruby on Rails? Join our newsletter.

We won't send you spam. Unsubscribe at any time.