Ruby on Rails is an open-source web development framework written in Ruby. Ruby on Rails follows the principle of convention over configuration, freeing you from having to re-invent things to stay productive. Ruby on Rails 4.0 is now available.
0
votes
1answer
4 views
Passing parameters with links
routes.rb
resources :carts do
resources :cart_items
end
rake routes:
cart_cart_items POST /carts/:cart_id/cart_items(.:format) cart_items#create
When I click on the link, it ...
0
votes
2answers
12 views
Paperclip: width is 100%, height is 60% of width
How would I write a Paperclip style to keep the width of the uploaded image at 100% but crop only the height to 60% of the width?
Something like this:
has_attached_file :image, :styles => { ...
0
votes
1answer
8 views
Cache ajax response for loading records - Rails 3
I have the following code which retrieves the current users notifications and renders a partial each time the #notifications link is clicked via ajax. .
How can I cache the ajax response so that, ...
0
votes
0answers
14 views
Rails Devise+Omniauth Facebook redirect to users/sign_up fails
So, im using Rails 4, ominiauth and facebook ominiauth but when i try login always redirect to users/sign_up in devise to create a new user, in my console appear this:
Started GET ...
0
votes
1answer
12 views
Github API v3 - Fetch diff of specific commit
I'm trying to figure out how to fetch the diff from a specific commit on Github. (Basically, just a series of individual file diffs, associated with a particular commit).
Some of the links on this ...
0
votes
1answer
16 views
how to show genres through associatin in the song controller?
if you go to www.leapfm.com you'll see each song has a youtube url in parenthesis to the right of it. After gauging feedback I have decided to instead display the genre tags in the parenthesis.
When ...
1
vote
0answers
20 views
Using two Rails models to fill out webform
Pretty new at Rails here, and I'm using Mechanize to fill out web forms on another website. The good news is that the hard stuff is mostly out of the way. I just need a way to connect two models in ...
1
vote
1answer
6 views
Rails updating model through association
I have the following two models:
class Process < ActiveRecord::Base
has_many :activities, inverse_of: :artifact, dependent: :destroy
attr_accessible :name, :activities_attributes
def ...
0
votes
1answer
11 views
Dynamic branch name for git based gems
I am using bundler to deploy gems from an in house git repository into my rails app. I would like to have different branch names for different groups, however, this:
group :production, ...
0
votes
1answer
20 views
Route to page /:permalink from root rails
I have a PagesController in rails and each page has a permalink, which can't change...
I'd like to route to that from "/", i.e "/contact" instead of "/pages/contact".
(It's not an option to use get ...
0
votes
0answers
7 views
Error in Devise Registrations controller with Rails 3.2.13
I get this error when signing up a new user:
ArgumentError (wrong number of arguments (0 for 1)):
app/controllers/devise/registrations_controller.rb:15:in `create'
Is there something wrong with my ...
0
votes
1answer
28 views
Rails - undefined method `api_key' for nil:NilClass
Im trying to store my api key in a yaml file
fresh_desk.yml
production:
:api_key: 12345
staging:
:api_key: 12345
development:
:api_key: my api key here
then in my lib folder i have a file ...
0
votes
1answer
31 views
Postgresql error after installation
I already have a rails project then i installed Postgresql and pgadmin III , I need to use posgresql in development instead of sqlite and production to use heroku , I followed the answer number two in ...
0
votes
1answer
16 views
Ember Routes and Rails Routes
This is the question that I've had ever since I started studying Ember to see how it might work with Rails.
Rails has a routes.rb file with any number of existing routes.
Ember has its own separate ...
1
vote
1answer
16 views
When building a json api for a model with a belongs_to association, the whitelisted attributes of that association are ignored
I'm building a json api for my model, User and a User belongs_to :role. Even though I have already build a json api for Role and whitelisted the attributes I wanted to include, the whitelisted ...