Data dodania Pytanie
2017-03-18 10:03 Getting ProgramLimitExceeded: ERROR from order_as_specified gem »
I am using order_as_specified gem, to order my records in a custom order reach_order = [3,1,67,43,...] influencers = Influencer.order_as_specified(id...
(0) odpowiedzi
2017-03-18 06:03 graphql-ruby, rails generate graphql:install doesn't work »
When I run rails generate graphql:install, it throws errors, even I already gem install graphql and graphql-relay. These are the error messages. Run...
(1) odpowiedzi
2017-03-18 00:03 Rails is not sending custom metrics to NewRelic »
I'm trying to send custom metrics to NewRelic insights, but unfortunately it is not working for my Rails app that is currently sending default data to...
(1) odpowiedzi
2017-03-17 19:03 Why aren't my assets rendering in Rails 4? »
I've been working on a Rails app to conglomerate directories pulled from IPFS. For some reason, app/views/layouts/application.html.erb isn't rendering...
(1) odpowiedzi
2017-03-17 16:03 Can't access object of class nil Rails 4 »
I get this errormsg from doing tests in Rails 4 Error: ArticlesControllerTest#test_x: ActionView::Template::Error: undefined method `state' for nil:N...
(1) odpowiedzi
2017-03-17 14:03 Redirect to page with form fields filled »
I have two models in my application: class User < ActiveRecord::Base has_many :telephones end class Telephone < ActiveRecord::Base belong...
(0) odpowiedzi
2017-03-17 11:03 How it works find_by_* in rails »
May be its weird for some people about the question. By looking at the syntax its identifiable as class method. Model.find_by_* So if its class met...
(2) odpowiedzi
2017-03-17 10:03 How to run system command on heroku server? »
I am using OGR2OGR for converting geojson file into dxf format. It is working on local server but on heroku server it is not working. Find code which ...
(1) odpowiedzi
2017-03-16 21:03 How to dynamically switch text or button from follow to Un-follow using Ajax? »
All, I have a function within my controller that I am calling directly. However, once it executes I would like it to change to either follow or un-fol...
(1) odpowiedzi
2017-03-16 18:03 Arel: active relation from Arel::SelectManager with join »
Let us we have a Rails 4.2.x app and we have two tables posts and authors, and we want to use Arel to get the posts authored by an author with name ==...
(1) odpowiedzi
2017-03-16 16:03 Rails 3 switching to strong parameters ForbiddenAttributesProtection error not raised? »
I'm attempting to add strong parameters to a Rails 3 application, but it is still permitting all mass attribute assignment and doesn't raise an error ...
(0) odpowiedzi
2017-03-16 12:03 Replace until all occurences are removed »
I have the following strings: ",||||||||||||||" ",|||||a|||||,|" I would like to achieve that all occurrences of ",|" are replaced with ",," The o...
(4) odpowiedzi
2017-03-15 19:03 Writing a regexp as argument to gsub! method -- stumped? »
In my Rails 4.2.6 / Ruby 2.2.4 app, I have a db query method that generates a string; for example: "Chest - pectoralis, Quads - quadriceps, Hamstring...
(4) odpowiedzi
2017-03-15 09:03 Optimizing Rails Query »
is there anyway else to optimize this query? It takes about 44ms to run but would love for it to be much lower. Any ideas?? @@accepted_list = Histor...
(0) odpowiedzi
2017-03-15 09:03 How to DRY up associations in includes? »
I have a scope method in which i'm using includes to eager load all the necessary associations. But i'm not sure how to DRY up the associations used i...
(2) odpowiedzi
2017-03-14 22:03 Override gem method in rails »
I want to let users add interests -TV shows in this case-, and to make sure they type a correct tv show, I'm going to search imdb first and let them s...
(2) odpowiedzi
2017-03-14 07:03 Multiple days of week in one attribute in database »
I want to implement a feature in Rails using the option of multiple checkbox. User must be able to choose the days in which he want the emails, like M...
(1) odpowiedzi
2017-03-14 02:03 calling instance method on model and passing its parameters »
I have model.rb class Foo def baz(param1, param2, param3, param4) puts 'something' end end controller.rb def signup param4 = params[:par...
(2) odpowiedzi
2017-03-14 02:03 validates not calling my conditional method in rails »
I have the following simple validation code in my model. validates :repeat_period_id, presence: false, unless: :job_spec.nil? def job_spec_nil? lo...
(1) odpowiedzi
2017-03-13 19:03 Rails 4 or 5, index on "updated_at" column in Postgresql. What it means? »
I'm using Rails 5 with this: def index @posts = Post.all fresh_when(etag: @posts, last_modified: @posts.maximum(:updated_at)) end A friend of m...
(1) odpowiedzi
2017-03-13 19:03 Rails app on Heroku doesn't display 'Welcome aboard' page »
I've created a new Rails app. When I run the Rails app locally using the rails server command, the default 'Welcome aboard' page displays. I've deploy...
(2) odpowiedzi
2017-03-13 06:03 How to update a record with unchecked checkboxes? »
I have three rows of checkboxes on frontend side when I check some values and then pass on the parameters to controller, they look like numbers. Fo...
(1) odpowiedzi
2017-03-12 19:03 Ruby on Rails - List Cities with most recent updated timestamp for Place »
I have a model Place, that has a city, state, timestamps, etc. Obviously, I can have multiple Place records in a given city. What I need (for my sit...
(1) odpowiedzi
2017-03-12 17:03 ActiveModel::ForbiddenAttributesError in UsersController#create »
I know this has been asked a million times before but the suggested solutions didn't fix anything for me. def create @user = User.new(user_params) ...
(1) odpowiedzi
2017-03-12 01:03 Rails Couldn't find Object without an ID »
I'm trying to get the order of shop orders but Couldn't find Order without an ID error appear ActiveRecord::RecordNotFound (Couldn't find Order wi...
(0) odpowiedzi
2017-03-11 18:03 Grant permission error in rails »
I created database simple_cms. Then granted permissions from database side for production and test: GRANT ALL PRIVILEGES ON simple_cms_developement.*...
(0) odpowiedzi
2017-03-11 16:03 Ruby on Rails - Hide JS and some functions from showing in my view »
In my application I have a each do and some JS code that I use to run some functions in my view. My each do is giving some strings that I use as a ar...
(0) odpowiedzi
2017-03-11 16:03 Different home page before signin in rails app rather then login page »
Here, whenever i try to open localhost:3000 it automatically changes into localhost:3000/users/sign_in and login form gets appear. But i don't want ...
(2) odpowiedzi
2017-03-10 20:03 How can you stub a method on an OpenStruct? »
I have an rspec test that does the following: enrollment_hash = { checked_dependents: [] } enrollment = OpenStruct.new enrollment_hash ...
(1) odpowiedzi
2017-03-10 18:03 Error in Access-Control-Allow-Origin when Angular request to Rails »
I'm using Angular 2 to make an API(rails) request. When I make the http request through angular, I get the following error: XMLHttpRequest cannot loa...
(1) odpowiedzi
2017-03-10 12:03 Value not bind to the view from controller »
I have two select tags as follow <%= f.select(:floor_id, ProjectFloor.find(:all,:order => "name ASC",:conditions => ["project_id = ?", @pr...
(1) odpowiedzi
2017-03-10 11:03 nested div tags in rails »
I want to achieve this HTML code in my view <div class="progress "> <div class="progress-bar bgclre3559b" role="progressbar" style="width:...
(1) odpowiedzi
2017-03-10 06:03 How to test ActionMailer delivery_method in RSpec? »
I have 2 delivery_methods, switchable using a environment variable like so: config.action_mailer.delivery_method = :mailjet OR config.action_maile...
(2) odpowiedzi
2017-03-09 13:03 Rails model design for has_many with filter model »
I have a Client model that has_many :orders but each order also belongs_to :order_type. The OrderType here is used as filter table basically since eac...
(2) odpowiedzi
2017-03-09 11:03 Multiple form in rails »
Here I am trying to create a single form through which I want to save multiple data by one key press. For this I have created form in tabular format. ...
(1) odpowiedzi