Data dodania Pytanie
2017-10-15 22:10 Set route name for POST, GET PUT, PATCH, Rails 5 »
I am using Devise and change its default routes like this: devise_for :users, :path => '',skip: [:sessions] as :user do get '/forgotten' =&gt...
(1) odpowiedzi
2017-10-15 17:10 Rails Kaminari: items per page how to set up »
I'm trying using the Kaminari pagination to have a box where a user can set how many items per page to display. I have an issue with it because I'm ge...
(1) odpowiedzi
2017-10-15 16:10 Change default routes Devise Rails »
I have this routes.rb: devise_for :users, :path => '', path_names: { sign_in: "login", sign_out: "logout", sign_up: "...
(3) odpowiedzi
2017-10-15 14:10 Why am I getting Stale Object error for both threads? »
it "one should pass and other thread should fail" do begin self.use_transactional_fixtures = false concurrency_level = 2 number_of_times...
(0) odpowiedzi
2017-10-14 16:10 NoMethodError in Shops::RegistrationsController#create »
I noticed that I had a typo regarding a column_name in a table and I changed it. Also, I changed all the code and params that is associated with the c...
(0) odpowiedzi
2017-10-14 11:10 Rails4: How can I get the number of idle connections in an ActiveRecord connection pool? »
I can see a stat method defined for Rails 5 (http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/ConnectionPool.html#method-i-stat). Th...
(1) odpowiedzi
2017-10-14 10:10 Stripe account creation fails on Rails 4 »
I coded up a function to let e-commerce site members to create their own Stripe accounts for them to be able to receive payments through Stripe. I fol...
(1) odpowiedzi
2017-10-14 09:10 rails edit_model_name_url(@model_name) does not take me to edit page »
i want to redirect to edit page on dropdown change event from new page. if data is present in database for selected week then display that data in ...
(1) odpowiedzi
2017-10-13 20:10 Rails 4 Filter Index lists with toggle »
I have created a small ticketing system for my users. I have tickets as New, In Progress and Completed. I would like to be able to toggle on the page ...
(1) odpowiedzi
2017-10-13 17:10 How to access a rails app from an Android app? »
I've got a rails 4.2 app that uses devise and supports both database-backed and Google oauth2 for authentication. I am now looking to open up an API f...
(0) odpowiedzi
2017-10-13 16:10 is it possible to use a variable value across multiple actions »
I have index and show method like below def index @variable = SomeModel.includes(:some_other_model) end def show @variable = SomeModel.includes(...
(1) odpowiedzi
2017-10-12 22:10 Slow loading Rails 5.1.4 with Ruby 2.3.3-p222 »
I have standard view with 1 database query (MySQL). I am using Devise and method for checking is it user logged in layouts/application.html.erb: <...
(1) odpowiedzi
2017-10-12 14:10 Rails add 'rescue_from' method to application controller from patch//plugin »
I am trying to patch the ApplicationController of my Rails(4.2.5) application from a plugin. I want to add 'rescue_from ActiveRecord::RecordNotFound'...
(1) odpowiedzi
2017-10-12 11:10 How to edit user controller in devise so I can update my user's profile without devise »
I have an app that uses devise for sign up and login. I'm trying to create the edit account page. I was wondering if I can update the user informatio...
(1) odpowiedzi
2017-10-11 13:10 Updating to Rails 5 schema issue »
Recently I have been attempting to update an existing Ruby on Rails application from Rails version 4.2.7.1 to version 5.0.6. After spending a fair amo...
(0) odpowiedzi
2017-10-11 11:10 Rails: show name instead of Id in a show page »
I have two tables, accounts and items and I would like to show the buisness_name instead of the idfrom the accounts table on the view/items/show.html....
(2) odpowiedzi
2017-10-11 09:10 Reset Password - Skip validation »
I need to skip the zipcode validation during the password reset action. What i have written so far is as follows. User.rb attr_accessor :email_confi...
(2) odpowiedzi
2017-10-11 00:10 Rails and Postgres, group by hstore »
I have an 'Audit' model with name:string and data:hstore attributes - as follows: #<Audit id: 1, name: "my audit", data: {"publisher"=>"some...
(2) odpowiedzi
2017-10-10 19:10 Rails: NoMethodError in ItemsController#show »
I am receiving an error when accessing @favorites = current_viewer.favorites_items.where(item_id: @item.id) from my ItemsController: NoMethodError in...
(2) odpowiedzi
2017-10-10 13:10 jQuery ajax works but not native JS ajax »
I have the following code: Controller def some_method respond_to do |format| format.js { render js: "alert();" } end end JS This executes al...
(1) odpowiedzi
2017-10-10 10:10 "ActionController::InvalidCrossOriginRequest" error with AJAX request by plain JavaScript »
I have code like: jQuery.ajax({ url: url // Some URL }); The above code worked perfectly. But, I have a requirement to convert this code to pure...
(1) odpowiedzi
2017-10-09 21:10 import records using the gem roo »
I am trying to import records to the database using the gem roo using excel files, it works pretty well making use of this tutorial, I am importing ne...
(0) odpowiedzi
2017-10-09 18:10 Rails : Couldn't find Item with 'id'= »
I'm trying to implement add to favorites and I'm getting this error: ActiveRecord::RecordNotFound in FavoriteItemsController#index Couldn't find I...
(2) odpowiedzi
2017-10-09 13:10 rails_admin customise dropdown with belongs_to relationship »
I was trying to develop a basic rails_admin application. My usecase has Projects and Students. class Project < ApplicationRecord belongs_to st...
(1) odpowiedzi
2017-10-08 21:10 Error nested link in Rails »
I have a little problem of link. I have 2 models nested, one Faqcategoryand Faq. The route is resources :faqcategories, :path => 'faqs' do ...
(1) odpowiedzi
2017-10-08 13:10 How to resolve Rails Active Record MySql database connection timeout and lost connection »
Ruby on Rails production server gets down in a random period of interval, and gives the error of database connection timeout. I could not figure out. ...
(0) odpowiedzi
2017-10-08 01:10 Allow only owner of article to delete article using »
I am using Devise for users. Previously, only admin_role can create, delete, and edit articles. Users and non users can read articles. Here is how ...
(0) odpowiedzi
2017-10-07 23:10 How to conditionally add a bootstrap class to a button in rails »
I have upvote/downvote buttons on a site that I want to display differently depending on whether the user has upvoted the post or not. I'm using the a...
(3) odpowiedzi
2017-10-07 18:10 Rails 4: User Login for SubDomains »
I am creating a rails application that allows a user to sign up and create subdomains (communities). The user becomes the admin of each subdomain they...
(1) odpowiedzi
2017-10-07 10:10 Rails js.erb not rendering partial file but get response file rendered »
I have the following partial files _report.html.erb <h5>REPORT</h5> <hr/> <%= link_to "Extract REPORT", "#", :class => 'btn...
(3) odpowiedzi
2017-10-06 18:10 Add column in rails migration but column doesn't exist right away »
I have an old migration that adds a column into a table, then immediate add some data in that column. def change add_column :table_name, :column_na...
(2) odpowiedzi
2017-10-06 13:10 Why is Rails returning a different float value when using a different database? »
I have an app running Rails 4.2 with this migration create_table "nutrient_amounts", force: :cascade do |t| t.integer "nutrient_id", limit: 4 t.i...
(1) odpowiedzi
2017-10-06 10:10 Rails pundit gem, permit view to non signed-in users »
I'm using the pundit gem in order to give permissions to three different users(Admin, seller, viewer). Currently I got everything working, admin has a...
(1) odpowiedzi
2017-10-05 21:10 Rails Active Record query with multiple optional params »
What would be the optimised way to create an ActiveRecord query in a Rails 4.1 application controller which can 0 to 4 optional query params, in absen...
(1) odpowiedzi
2017-10-05 18:10 Rails 4.2 : Form with multiple models - param is missing or the value »
I'm having trouble with Rails 4.2 to create a form with multiple models. I'm creating a form to allow a user to order a gift card with a custom stripe...
(1) odpowiedzi