Skip to main content
Gravatar
CoffeeScript check if a checkbox is checked?
Javascript • Asked by shakycode
I have some simple CoffeeScript that toggles a div based off of if a checkbox is checked in a Rails form. The CoffeeScript looks like this: ``` $("#bill_patient_checkbox").change -> $("...

Gravatar
Flexible Nested Attributes
Gems / Libraries • Asked by Terence Devine
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...

Gravatar
Native Mobile Options
General • Asked by Brent C
I have a Rails 4 app that is fully responsive and works good on the mobile browser. However, I want to make native apps for it for iOS and Android. What are some recommended steps? Is Phonegap ...

Gravatar
DateTime causes StackError when config.time_zone set.
Rails • Asked by Wouter van den Beld
Hi, I have a strange problem When i do the following method with no config.time_zone set in the application.rb it works. ```ruby def send_assignment @assignment = Assignment.find(param...

Gravatar
ActiveRecord AssociationType Mismatch
Rails • Asked by shakycode
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: ``` Act...

Gravatar
Recurring Events
Rails • Asked by sid d
```ruby # Model def Event WEEKDAYS = ['sunday', 'monday', 'wednesday', 'thursday', 'friday', 'saturday'] end # Migration create_table :events do |t| t.column recurring, default: fal...

Gravatar
Active Record Associations
Rails • Asked by sid d
```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...

Gravatar
Ideas for building a Wiki in my app
General • Asked by Jay Killeen
My users are all internal customers of our business. They are pretty information poor when it comes to our systems and processes and our company intranet is not very feature rich. So I'd like to bu...

Gravatar
Refile :fill does not work for me
Gems / Libraries • Asked by Wesly Mezarina
I have the refile gem connected with aws by following the instruction on their github. For an image i would get something like /attachments/store/78b928c7897e3b12de80cf1ffdfdfdfdf/image.jpg ...

Gravatar
Links not working on production server
Servers • Asked by Edward Bishop
I'm at a loss. After finally successfully deploying using Capistrano, and finally figuring out why my assets were missing, I have another issue. I have a link that point to static pages (contact)...

Gravatar
Non Restful actions in the controller
Rails • Asked by Jay Killeen
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 w...

Gravatar
API Design Decisions
General • Asked by Chris Zempel
I'm designing & building an API for a company and have arrived at a decision point I can't figure out. we're providing access to records. right now they want to quickly integrate with one client...

Gravatar
Render \r\n in javascript.erb
Javascript • Asked by Wouter van den Beld
HI, I try to add the value of a text field in a form from a other database field. I use the following javascript ```javascript $("#assignment_conditions").empty(); $("#assignment_condition...

Gravatar
Using Devise in Consumer App
Gems / Libraries • Asked by rabin prithvi
I have two applications. One is Rails API consumer app and another is a legacy PHP one - which responds with JSON API. APIs are used for user registration and login. Can I use Devise for authentica...

Gravatar
Set field on multiple records on save/change of 1 record
Rails • Asked by Wouter van den Beld
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...

Gravatar
How to add records to has_many :through association
Rails • Asked by Wesly Mezarina
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 ...

Gravatar
How to make a good Sidekiq job?
Gems / Libraries • Asked by Tang Rufus
From the [Sidekiq wiki](https://github.com/mperham/sidekiq/wiki/Best-Practices#2-make-your-job-idempotent-and-transactional), a Sidekiq job should be idempotent and transactional. How should we imp...

Gravatar
Select Form Helper Required True Not Working
Rails • Asked by shakycode
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_option...

Gravatar
Deploy and delete text!
Servers • Asked by Artem Kiryanov
Help! When i deploy my app from local machine to vps, my local image, text and another information have been deleted! How can i fix it?

Gravatar
Import CSV data using RubyZip and Postgresql COP
Gems / Libraries • Asked by Jay Killeen
I've checked out the videos on importing data to your rails app. Very timely as I am deep into this feature bringing data from all our legacy systems into my rails app. My issue is I am importin...