Questions tagged [ruby-on-rails-4.2]

For issues specific to version 4.2 of Rails. If your question applies to Ruby on Rails in general, use the tag [ruby-on-rails].

Ruby on Rails 4.2 is the latest major revision of Ruby on Rails, "an open-source web framework that's optimized for programmer happiness and sustainable productivity." Rails 4.2 brings a bunch of new features and improvements over older Rails versions.

See Ruby on Rails 4.2 Release Notes for more information.

Resources

Related tags

702 questions
0
votes
2 answers

Rails named route with dynamic segments URL generation from model

Ruby on Rails 4.2+ only, please! I've been looking all over for tips on how to make URLs pretty in Rails, and I'm struggling to see a solution I like. What I want: Hypothetical example: given Topic, Course, etc. models that have a bunch of fields…
0
votes
1 answer

Rails 4.2 will_paginate error

Trying to upgrade to Rails 4.2 from 4.1.8 and I'm getting a "wrong number of arguments (2 for 0..1)" for this line: <%= will_paginate(@search) %> Works perfectly find in Rails 4.1.8. @search is a custom object which defines the methods…
painbot
  • 160
  • 9
0
votes
1 answer

Rails 4.2 - how to build a has_many, through: association with collection_select

I'm currently using Rails 4.2 with these models: class User < ActiveRecord::Base has_many :user_accessories, dependent: :destroy accepts_nested_attributes_for :user_accessories, reject_if: :all_blank, allow_destroy: true has_many…
s_dolan
  • 1,196
  • 1
  • 9
  • 21
0
votes
0 answers

Rails 4.2 undefined method `original_filename'

I have a contact form with a file attachment field that works perfectly fine on Rails 4.0.5 but give me the above error on Rails 4.2. My aim is to allow customer to upload an image through the form and the image gets attached to the admin sent to…
Dan Mitchell
  • 844
  • 2
  • 15
  • 34
0
votes
2 answers

Problems with delete, update in Rails 4.2 and backbone

I can not catch the problem. Don't have critical errors. All work fine at other Rails app, with the same config. class PricesController < ApplicationController respond_to :json def index @prices = Price.all respond_with @prices end …
colmer
  • 99
  • 6
0
votes
1 answer

separate Sign In for user and admin rails 4.2

I am building forum application using rails 4.2.I have two user roles in my application that is "user" and "admin" like below enum :role=> {:user=>0, :admin=>1} right now there is single Sign In in my application which is provided by devise gem. I…
Hemant Patil
  • 331
  • 2
  • 18
0
votes
1 answer

Authorization with Devise and multiple levels

I need some help with the authorization. So far I was trying to solve it with the internal rails authorization combined with devise. I have a user who is posting a request. If this request is private only a group of "reader" can see and answer the…
ertix4248
  • 41
  • 1
  • 6
0
votes
1 answer

Migration ERROR when adding unique constraint to model! "standard error"?

In my rails app, I want to add a unique constraint to my favourites model. (I'm remaking a basic twitter app, with users and tweets, and generated a third model for favourite). However when I try and add a unique constraint to my favourites model so…
TABISH KHAN
  • 1,553
  • 1
  • 19
  • 32
0
votes
1 answer

Rails 4.2 not reading Environment Variables for Database.yml

My database.yml file does not seem to be picking up the environment variable correctly. When I put the password in directly, there are no issues, so I know it's not a password problem. I've also restarted the server. Also, when I launch IRB on the…
fatfrog
  • 2,118
  • 1
  • 23
  • 46
0
votes
1 answer

How to add a new Parameter

i am still learning ruby on rails. My first site is running but now i have this problem: I run rails generate scaffold staat name:string hauptstadt:string einwohner:integer sprache:string How is the best way for add a param like "test:string" for…
user1988341
0
votes
2 answers

ActionController::ParameterMissing in rails application

Getting a missing params information in the controller., here is the code of the controller class SubjectsController < ApplicationController layout false def new @subject=Subject.new end def create @subject =…
sathish_at_madison
  • 823
  • 11
  • 34
0
votes
1 answer

Rails 4 essential training : redirection error

hi I'm getting the following error: Unknown action The action 'other_hello' could not be found for DemoController after typing this redirection code (which is exactly the same as shown in Rails 4 essential training) I'm using rails version 4.2.0 def…
0
votes
3 answers

Adding numbers and save to the database using Ruby On Rails

Im new to RoR and I have a hard time in experimenting some syntax. I don't know how to add two inputted numbers coming from here:
<%= f.label :point1 %>
<%= f.number_field :point1 %>
<%= f.label…
ana
  • 603
  • 6
  • 17
0
votes
2 answers

Rails 4: Model validation not working on create

I have a little -seems simple code that has me knocking my head around the place. Here is a user model: class User < ActiveRecord::Base has_one :api_account, inverse_of: :user, dependent: :destroy # Other user-specific validations come…
igreka
  • 330
  • 3
  • 15
0
votes
1 answer

422 Returned with "password cannot be blank" Rails 4.2

I have a controller for my users: class API::V1::UsersController < ApplicationController respond_to :json def create @user = User.create(user_params) respond_with(:api, :v1, @user) end end` I'm using the responders gem. When I run my…
jmcharnes
  • 707
  • 12
  • 23