Data dodania Pytanie
2017-03-15 19:03 Rails form preview page »
I want to save the Job data in the database, and redirect to a preview page (instead of the show page) which displays all the information from the Job...
(2) odpowiedzi
2017-03-15 19:03 Rails: Include Model based on column value »
Consider the pseudo models: Product id type - enumerable 'book' or 'magazine' Book ...attributes Magazine ...attributes Whe...
(2) odpowiedzi
2017-03-15 19:03 ActiveJob: start a job automatically when starting server »
For example I have a job that I want recurrence every 1 hour. Here is my code: class NewsletterJob < ApplicationJob queue_as :default after_p...
(1) odpowiedzi
2017-03-15 18:03 Accessing rails loop variable in JQuery »
I have the following html code: .panel .row .columns.small-6.medium-4 = city_business_units_select_tag @appointment .columns.small-6.medium-4...
(0) odpowiedzi
2017-03-15 18:03 How can I simulate `OR` conditions for `has_many` association in Rails 5? »
I want to simulate OR conditions for has_many association so I do not lose active record association. I understand this can be achieved using scope or...
(1) odpowiedzi
2017-03-15 18:03 Sidekiq jobs aren't firing in development mode, only in production »
Edit: I was just told by our team that docker is not even used for production. So it seems the issue is limited to Docker and not the environments tha...
(1) odpowiedzi
2017-03-15 17:03 Find by linked fields Rails 5 »
I have a model that works like this: class User < ApplicationRecord has_many :deals ... class Deal < ApplicationRecord belongs_to :user h...
(1) odpowiedzi
2017-03-15 17:03 rspec email_spec and jobs.. how does it work? I want to check whether the letter was sent.. and maybe email body »
I have 'controllers/users_controller.rb' def create user = User.new(person_params) if user.save EmailSendJob.perform_later(user.email, 'ra...
(3) odpowiedzi
2017-03-15 13:03 Rails add new and edit form in bootstrap modal »
I'm new with Ruby on Rails. Now I'm trying to make a simple ToDo List app with bootstrap. Everything works but I tried to render my New task form to...
(2) odpowiedzi
2017-03-15 12:03 RSpec controller test not raising error »
I just noticed weird Rspec behaviour. I wonder if it's Rspec's error or my approach to testing is incorrect. I have this controller test (I cut out ...
(1) 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 23:03 RSpec test not hitting view with render_view »
I am getting this error when using RSpec to test an index action and response in a Rails controller: JSON::ParserError: A JSON text must at...
(1) 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 21:03 activerecord how to query for multiple conditions on association? »
I am trying to make a scope for my EventsLog model which looks something along the lines of EventsLog.with_values({"value_name" => "value", "other_...
(1) odpowiedzi
2017-03-14 20:03 Rails 5 API protect_from_forgery »
I have a Rails 5 API app (ApplicationController < ActionController::API). The need came up to add a simple GUI form for one endpoint of this API. ...
(3) odpowiedzi
2017-03-14 19:03 Capybara undefined method 'current_scope' »
I have the following code scenario "it should not appears submenus' links if it doesn't has any" do expect(page.find('li.main-category', text: "Sta...
(1) odpowiedzi
2017-03-14 17:03 Inconsistent results when passing array to ActiveRecord#where »
I'm using Rails 4.2.7.1, Ruby 2.3.1 and MySQL as my DB. I have a background job that is responsible for collecting analytics about the database which ...
(1) odpowiedzi
2017-03-14 17:03 SQL + Rails - is it posible to get a collection of objects with the values of attributes from other table columns »
class Baby belongs_to :child attr :is_public scope :public, includes(:child).merge(Child.public).where('babies.is_public IS TRUE') end class Ch...
(1) odpowiedzi
2017-03-14 15:03 Rails How to retrieve act-as-taggable-on tags on multiple levels of associations »
Summary I have acts_as_taggable_on :skills in my Ad.rb Model. I have the following relationships: Host Model has_many :locations Location has_many...
(1) odpowiedzi
2017-03-14 10:03 Getting Nil while testing Controller with Rspec »
I´m trying to test my Controller in Get Index but i always recieve the Error 'got Nil'. This is my code for Spec: require 'rails_helper' describe...
(0) odpowiedzi
2017-03-14 07:03 Faraday::SSLError: SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read se rver hello A on rails and google drive gem »
I am having an issue on windows and rails using the "google-drive-ruby" gem, When I try to do the "On behalf of you" authorization, after initializing...
(1) 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 04:03 Rails 3: Get helper_url from path »
I am trying to get the helper_url from the current path. For example if I have the following route: get "user/:user_id" => 'user#user_info', :as =...
(1) odpowiedzi
2017-03-14 02:03 Count fails with aggregate function in Rails »
I have a query like the following: Author.select('authors.*, max(books.published_at) as last_publishing') .joins(:books) .group('authors.id') T...
(0) 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 23:03 ActiveRecord::StatementInvalid in Devise::RegistrationsController#create »
I'm trying to add some extra information to my Devise User model like first_name, last_name, age, gender and city. When I fill the signup form and cl...
(2) odpowiedzi
2017-03-13 22:03 Eager Load Depending on Type of Association in Ruby on Rails »
I have a polymorphic association (belongs_to :resource, polymorphic: true) where resource can be a variety of different models. To simplify the questi...
(4) 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 18:03 No Method Error while testing with Rspec in Rails »
I get a No Method Error while Testing with Rspec. Here is my code for the Test: scenario 'admin updates a commissionrate' do create(:assignment, us...
(2) odpowiedzi
2017-03-13 16:03 List of ActiveRecord DB datatypes as symbols/strings »
This is a really short question: Is there a list of all datatypes I can use for columns in a mysql database with ActiveRecord? I know the datatypes a...
(1) odpowiedzi
2017-03-13 15:03 Capybara::Poltergeist::MouseEventFailed. Poltergeist detected another element »
I am using capybara to test my button click function. require 'spec_helper' describe 'journals edition', js: true do let(:update_button) { find('[...
(1) odpowiedzi
2017-03-13 14:03 ActiveAdmin nested form duplicate »
I know there are multiple questions with a similar title to this, but I haven't found anything that resembled my problem. If there is already a soluti...
(2) odpowiedzi
2017-03-13 10:03 Rails .where() query not working »
Thanks a lot for your help. I have a locations and ads table. Location has_many :ads I perform the following query on Location Model. @locations = Lo...
(1) odpowiedzi