ruby-on-rails-4 Questions

2

I'd like to lint the files in my rails project (ideally, in my editor while making edits) via eslint, but I am currently unable to lint files that are pre-processed with ERB. How can I include *.j...
Snowber asked 10/6, 2015 at 5:16

4

I added the key into heroku config var, but I'm still getting the error. Is this the correct way? I ignored secrets.yml as I read from other sources that its not a good idea to push this to the pu...

4

Solved

Just upgraded to Rails 4.2 and I get Internal Server Error on localhost and in production when trying to edit a model with multiple has_many objects. This is the message I see on the rails s consol...
Caltanissetta asked 5/1, 2015 at 4:20

7

Solved

I have the following code in a Rails controller: flash.now[:notice] = 'Successfully checked in' redirect_to check_in_path Then in the /check_in view: <p id="notice"><%= notice %>&lt...

5

Solved

I installed rvm with rails, from the official website of RVM, I specified the command suggested by the tutorial. When the installation my system has rails 4.0.0, rvm 01/23/12, ruby 2.0.0, bundler g...
Homovec asked 25/10, 2013 at 17:25

3

Solved

I am using Rails 4.2.3 and ruby 2.2.1 I have written a scope in roles model as follows: app/models/role.rb scope :default, -> { find_by(default: true) } Now when I run > Role.default #...
Style asked 9/7, 2015 at 22:44

4

Solved

I need to force SSL on all routes in my application except for message#new controller. In config/environments/production.rb, I have: config.force_ssl = true Now all routes being redirect to htt...
Penton asked 15/7, 2015 at 5:13

3

I don't know why I can not use rack-attack gem Here what I did Gemfile gem 'rack-attack' I ve installed the gem config/application.rb config.middleware.use Rack::Attack initializers/rack-a...
Jemmie asked 18/11, 2015 at 11:27

8

Solved

I`m in root of my application, and when I type $ rails console It looks like something is loading, but nothing happens. And when I stop ^C I received this trace: ^C/home/jonatas/.rvm/gems/ruby...
Wolgast asked 18/6, 2014 at 2:8

3

I was having some issues getting the mysql2 gem to install on my Windows 8.1 machine. I followed the instructions in this post: Ruby MYSQL2 gem installation on windows 7 to install the mysql2...
Deviant asked 14/1, 2014 at 23:35

5

Solved

I have a controller based on MHartl's RoR4 Tutorial And just like MHartl, I'm not using Devise, I rolled my own authentication system Having trouble with the RSpec for UsersController#Edit since ...
Dyer asked 2/7, 2014 at 3:13

12

Solved

I got error NOAUTH Authentication required when I connect to Redis server via command: redis-cli and run ping to check if Redis is working. I found answer for NOAUTH Authentication required error ...
Ebon asked 6/12, 2015 at 7:48

20

Solved

Im trying to install an open source rails 3.2.21 application that uses the mysql2 gem, but when i try and run the bundle commant I get the following error: Fetching: mysql2-0.3.18.gem (100%) Build...
Angelia asked 14/6, 2015 at 20:53

3

I am planning to build Rails app with mongoDb, but I don't know will I be able to use active record associations such as many-to-many etc.? Also, when I use mongoDb with rails, do I replace Active ...
Dola asked 29/2, 2016 at 18:54

6

I'm using Rails 4.1 and Postgresql (with PG gem) as my database. I have a very stand many to many association from companies to provinces with a join table called regions. Now obviously the regions...
Rascal asked 19/4, 2014 at 2:58

6

Solved

As the question states, why is it considered best practice to store telephone numbers as strings rather than integers in the telephone_number column? Not sure I understand the rationale for this. ...

2

Lets imagine, I have a route defined like the following: constraints MyRouteConstraint.new do get ':param/:param1/:param2', to: 'controller#action' end How can I get the pattern ':param/:param1...
Adelia asked 1/3, 2015 at 18:39

8

In my Rails 4 app I would like to collapse my migration files into one large file (similar to schema.rb) as it's time to do some housekeeping but I'm not sure on how to access the table in the data...
Bolanger asked 30/9, 2013 at 17:33

5

Solved

I have 3 models in my rails app class Contact < ActiveRecord::Base belongs_to :survey, counter_cache: :contact_count belongs_to :voter has_many :contact_attempts end class Survey < Activ...
Dionisio asked 12/2, 2014 at 4:1

4

Solved

I have this query: Client.select("name as dname") Which is working fine. Client.select("name as dname").first.dname => "Google" Now I want to get all dnames as an array but pluck method do...
Marcelinomarcell asked 3/10, 2016 at 13:13

7

Solved

First I have created an active_admin css file as app/assets/stylesheets/active_admin.css.scss /* active_admin.css.scss */ @import "active_admin/mixins"; @import "active_admin/base"; /* applicatio...
Cargill asked 10/10, 2013 at 19:34

4

Solved

Is there any way to ask the Asset Pipeline if an asset exists? The suggestions I largely see involve manually checking the file path with File.exist?. The problem with that is that I have several g...
Hybridism asked 13/9, 2014 at 18:59

4

Solved

I've been pulling my hair out for this one. I've always had a bad relationship with the asset-pipeline, it is always giving me trouble.. And today again.. When I try and compile my assets locally,...
Bobbysoxer asked 17/7, 2014 at 16:58

11

I have a svg image on /app/asssets/images/symbols.svg with this as contents. <svg xmlns="http://www.w3.org/2000/svg"><symbol id="icon-search" viewBox="0 0 18 18"><path fill="curren...
Unexpressed asked 2/5, 2016 at 16:14

3

Solved

I want to setup schema.org metadata using json ld. for example following link uses ghost and it has "application/ld+json" meta data. http://blog.ghost.org/distributed-team-tools/ I want to achiev...
Geotaxis asked 31/12, 2014 at 9:22

© 2022 - 2025 — McMap. All rights reserved.