Ruby on Rails Community Forum

SQL injection attempts, any advice?

4
General
Hi there, In the logs of Rollbar for my app [petithacks.com](http://petithacks.com), I have seen in the past 2 days attempts like the ones in the image ![SQL injection attempts](http://static.tum...
Javier Sanz replied

Code Challenge idea

5
General
Chris and I were talking about starting a challenge/kata exercise for the community in Ruby/Rails. Based off of the idea of [Underhanded-C](http://www.underhanded-c.org/), we could post a weekly, ...
Chris Oliver replied

Restrict Rails Model To Create after Certain Condition

1
General
Requirement:: We have implemented Passport where any user can subscribe to this passport. I want to restrict subscriptions after 20 subscriptions happen. How can we go with this. Any ideas ?
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

Multiple objects in form and controller, hitting a wall.

0
General
So I'm working on a old version of a legacy app Chris and I paired on, trying to refactor some functionality and am hitting a wall. I currently have some basic paging functionality which creates a...
shakycode posted

Episodes Source Code

4
Site Feedback
Is there any way you can provide us with the source code for the episodes?
Chris Oliver replied
Solved

Refile S3, presigned, multiple files + Cloudfront - generating images via javascript

8
General
Hello, I have followed along with both videos, but have come up with a little issue while attempting to generate a thumbnail within the success event. It seems to be automatically requiring the to...
Dean Fields replied

Ransack Scoping issues

16
General
Hey everyone, Just posted this question to stack overflow but thought I'd give it a try hear. I've been trying to figure out how to scope ransack searching for a couple of weeks but haven't figured...
alexander kehaya replied

Coffeescript Polling Issues

6
Javascript
I'd like to reload an iframe when the images needed to generate the preview it will display are cached by background workers. However, I can't figure out how to get setTimeout() to work correctly (...
shakycode 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

HTTParty and trycelery.com API

2
General
Ok. I have tried for 3 days and I'm not getting anywhere. I am building a small kickstarter style campaign module for several products that will be run through Celery. What I want to accomplish ...
Edward Bishop 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

How to build a web scraper using Ruby...

1
Ruby
Hello Chris - can you please teach us how to build a web scraper using Ruby to collect data from the web?
Chris Oliver 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

CoffeeScript check if a checkbox is checked?

10
Javascript
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 -> $("#...
David Becerra replied

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

Refile :fill does not work for me

1
Gems / Libraries
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 w...
Chris Oliver replied

Learning Ruby on Rails? Join our newsletter.

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