皇冠hg0088代理网址

Questions tagged [ruby-on-rails]

Ruby on Rails is an open source full-stack web application framework written in Ruby. It follows the popular MVC framework model and is known for its "convention over configuration" approach to application development.

Filter by
Sorted by
Tagged with
0
votes
0answers
3 views

Rails `NameError: uninitialized constant` only in production (not console) - class is in /app subfolder - needs to add double colon `::`

In a Rails 5.2 app, I have a class Foos::SomethingSerializer, stored in app/serializers/foos/something_serializer.rb. In Development, this controller code works just fine: # api/v1/foos_controller.rb ...
0
votes
0answers
3 views

Getting error while transfer repository from Gitlab.com to self hosted private Gitlab instance?

I am trying to migrate my repository from gitlab.com to my newly installed self-hosted Gitlab which is on my company's internal infrastructure - gitlab-private. I was working on gitlab.com but now we ...
0
votes
1answer
21 views

ActiveRecord WHERE with namespaced models

I've two models within the same namespace/module: module ReverseAuction class Demand < ApplicationRecord belongs_to :purchase_order, inverse_of: :demands, counter_cache: true end end module ...
0
votes
0answers
10 views

Capybara/Rspec - Session Lost on second scenario with Ajax request

I'm beating my head on trying to solve this issue. I have a feature spec that I'm writing where I have multiple scenarios written and I want them all to run within the same user session. The tests run ...
0
votes
0answers
11 views

What's the timestamp format in a rails cache entry in redis?

When I look at a rails cache key in redis, it looks like this: get cache:pause_mything "\x04\bo: ActiveSupport::Cache::Entry\t:\x0b@valueT:\r@version0:\x10@created_atf\x171598381810.4477415:\x10@...
1
vote
2answers
24 views

Passing rails variable to liquid works in console but not in view

I want to pass a hash to the render method. In my console everything works fine when I do this: @object = Object.find(params[:id]) @hash_object = @object.to_liquid @template = Liquid::Template.parse(&...
0
votes
1answer
14 views

Rails sorting by popularity score

I'm trying to display items by an external popularity score that gets generated by looking at the number of "likes" the item has. item.rb belongs_to :restaurant has_many :liked_items ...
0
votes
1answer
9 views

Ruby on Rails Routes for custom Devise Signup and Signin forms

I hope all is well. Im trying to edit sign up and sign form but my edits for the views/users/registrations and sessions directories wont take any effect. Am I doing something with the route? Thank you ...
-2
votes
1answer
23 views

Query the first 15 users who added the most points using Ruby on Rails?

I Have a table users with a integer column called points. How can I query the first 15 users who added the most points?
0
votes
0answers
8 views

How to avoid the error related to compiling with Webpacker with rails-erb-loader?

In Rails 6, I need to add .js.erb support for Webpacker and I'm experiencing the error while building even default .erb: ERROR in ./app/javascript/packs/hello_erb.js.erb Module build failed (from ./...
0
votes
1answer
24 views

Sorting rows in postgres based on joined table - Rails

I have the following situation class Book has_many :book_publications has_many :publications, through: :book_publications end class BookPublication # book_id # publication_id end class ...
-1
votes
0answers
19 views

Postgres and ruby ​integration

I am trying to create a base in Postgres integrated with ruby, I have already installed all the dependencies. But running "rails db: create" I get this error "PG :: ConnectionBad: FATAL:...
0
votes
1answer
15 views

flag_shih_tzu gem , return same value for any key

im using flag_shih_tzu gem and at my User model I include that lines include FlagShihTzu has_flags 2 => :admin, 3 => :moderator I have a column flags as well in User table : t....
-2
votes
0answers
21 views

bootstrap-star-rating not displaying stars in rails [closed]

I am trying to use bootstra-star-rating in my rails application using this: http://github.com/kartik-v/bootstrap-star-rating. After adding css and js files, stars are not showing up.As you can see ...
0
votes
0answers
17 views

early return on devise active_for_authentication method

I have two user types, Parent and Child. I have an active_for_authentication method on Child which uses a is_suspended column on Child which works perfectly. However a Parent can 'masquerade' into a ...

15 30 50 per page
1
2 3 4 5
21391