ruby-on-rails-4 Questions
2
Solved
I'm using jQuery DataTables in a new Rails 4.2 project. I've got a large number of results that need to be filtered on group, project, and status. Choosing the group filters the project selection, ...
Blizzard asked 9/12, 2016 at 23:46
17
Solved
I have a simple model called PhoneNumber:
class PhoneNumber < ActiveRecord::Base
validates :pnumber, presence: true, on: :create #=> { :message => " cannot be blank" }
validates :pnumbe...
Galvani asked 15/10, 2014 at 22:51
4
Solved
Ubuntu 14.04.
So everything was working fine and I had my terminal open with two tabs - one tab had webbrick running on my sebcoles project, and the other tab I used to clone my english_teacher re...
Aquiculture asked 6/5, 2015 at 17:17
4
Solved
I'm wanting to use UUIDs in an app I'm building and am running into a bit of a problem. Due to UUIDs (v4) not being sortable because they're randomly generated, I'm trying to override ActiveRecord:...
Rheum asked 14/6, 2015 at 3:8
5
I am trying to get ruby on rails to set up on my mac running os x 10.10. I am trying to get a server running open source project kandan however I am getting an error when trying to bundle install o...
Spooner asked 7/8, 2015 at 14:50
6
Solved
I'm submitting a form with 2-4 objects at once, depending on how many the parent has. I realize that this is probably unconventional, but I really wanted the user to be able to edit all of the obje...
Latoyia asked 11/8, 2015 at 14:48
6
Solved
I installed puma gem and when I start rails server by rails s I can see full output:
$ rails s
/Users/serj/.rvm/gems/ruby-2.2.1@email_platform/gems/htmlentities-4.3.2/lib/htmlentities/mappings/ex...
Carrington asked 6/8, 2015 at 18:13
7
Solved
I am using friendly_id in my rails 4 application with slug. Now I am using active_admin gem.
Problem:
When I click on show link from active admin for Group resource, It is throwing the following ...
Subbase asked 20/11, 2014 at 6:9
2
Is it possible to move sidekiq job straight to dead queue from SidekiqWorker instance level (i.e. while executing)
class MyWorker
include Sidekiq::Worker
sidekiq_options retry: 9
def perform(n...
Bainbrudge asked 27/11, 2015 at 11:34
5
Solved
I am using an after_action callback in my mailers to record that email was sent. The emails are sent through Delayed Job. This works, except when we are unable to reach the remote server - in which...
Cochlea asked 21/3, 2016 at 20:3
7
Solved
I'd like a Rails controller (all of them, actually, it's an API) to render JSON always always.
I don't want Rails to return "route not found", or try and fail to find an HTML template, or return 4...
Chesna asked 30/5, 2014 at 3:37
3
I'm using ActiveAdmin for the backoffice of my application and I have these three models:
class Organization
has_many :organization_collection_relations
has_many :collections, through: :organiza...
Cartagena asked 10/10, 2018 at 6:49
8
Solved
I have an index page that builds a table, and I am trying to allow users to edit line's in the table. I am trying to do this in the most basic way possible - no javascript, ajax, etc, unless Rails ...
Blackheart asked 14/10, 2013 at 17:30
3
Solved
I'm trying to render the integrated 404 page in rails as an exception. I tried this but still getting the routing error page:
posts_controller.rb
def destroy
if current_user.username == @post.ema...
Iniquitous asked 30/3, 2014 at 19:25
3
Solved
I have next spec file:
require 'rails_helper'
describe Order do
it "calculates the total price of the order" do
item1 = create(:item)
item2 = create(:item, price: 20)
order = create(:order)
...
Overgrowth asked 2/5, 2015 at 20:26
10
Hello,
I have problem with ActionMailer, when I try to execute action:
rake send_email
I get a error:
rake aborted!
ActionView::MissingTemplate: Missing template user_mailer/mailer with "m...
Takin asked 22/6, 2015 at 15:50
3
Solved
Hi I need to validate phone number in these formats
+1-541-754-3010 , (123) 986-5470 and 123-569-8740 I have given following regex
validates :phone, format: { with: /\A\(?\d{3}\)?[- ]?\d{3}[- ]?\...
Roti asked 4/8, 2015 at 12:2
3
Solved
I am using Bootstrap, which has div class="alert notice" that has a bunch of classes for various notice messages.
I also have an AJAX destroy action for a comment, that I have added cancan authori...
Shambles asked 16/10, 2014 at 8:7
4
Solved
Im looking to query all Users without Comments in a single sql query?
Models:
class User < ActiveRecord::Base
has_many :comments
end
class Comment < ActiveRecord::Base
belongs_to :user
end...
Sclerite asked 16/4, 2014 at 2:16
1
Expressions like the following are common in Rails:
@project = Project.find params[:id] # example 1
@project = current_user.projects.find params[:project_id] # example 2
However I realize that ...
Schwann asked 1/9, 2016 at 10:14
7
Solved
Just wondering whether there's a way to use turbolinks directly in a rails link_to helper, a quick bit of googling didn't uncover anything of note, here's the type of thing I've tried to no avail.
...
Valetudinarian asked 9/1, 2013 at 2:23
5
Solved
I have a problem when I do:
namespace :xaaron do
task :get_roles do
roles = Xaaron::Role.all
puts roles
end
task :get_role, [:name] do |t, args|
role = Xaaron::Role.find(args[:name].paramet...
Entertaining asked 11/12, 2014 at 20:9
6
Solved
In a partial, I want to add a class only if the is_embedded local variable was passed in and is true. How can I check this?
Currently I check if is_embedded is true like this:
_some_partial.html....
Jackfruit asked 11/4, 2014 at 16:52
8
Solved
I want to be able to use two columns on one table to define a relationship. So using a task app as an example.
Attempt 1:
class User < ActiveRecord::Base
has_many :tasks
end
class Task <...
Colonial asked 8/7, 2014 at 21:38
2
How can I go about generating an image of a database schema used in a Rails app?
Archiepiscopate asked 26/1, 2009 at 22:18
© 2022 - 2025 — McMap. All rights reserved.