返回首页

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
10 views

How to Find a String in a Directory of Files Using grep and glob?

So I've been messing with this for the last hour and a half or so and just can not figure out how to do this. In my Ruby test.rake file, which gets called from another project after a Snapshot Gem is ...
-1
votes
0answers
8 views

What are some strategies to add Google OAuth2 to a Rails API?

I have a client side application (react/redux) that can send a token to my backend but am having trouble using the Google Authentication interface. It's looking for a very specific shape. What should ...
0
votes
0answers
8 views

Problem sending data to a Rails API from a Vue App

Hey all I have a Rails 6 API that I'm trying to get talking to my Vue App. When I am trying to submit my form to my signup url I am getting this error: Started POST "/api/v1/signup" for ::1 at 2019-...
0
votes
0answers
8 views

How to upload video from desktop use gem “ckeditor” in rails?

I use gem "ckeditor" for a textarea, but it just only upload image, i want to upload video from desktop/link online. How can I do?
0
votes
0answers
15 views

Listening to HTTP Json stream triggers JSON:ParserError

My Rails project is listening to a text/json type HTTP stream – It normally works fine until about an hour in, and then the API seems to send two objects at once and it triggers a JSON::ParserError, ...
1
vote
0answers
17 views

rails - assign preexisting record as nested association while updating nested attributes

I am not using a rails form as this is all coming from an XML that I am parsing. For my requirement, I need to assign an existing record as nested association while at the same time, updating selected ...
0
votes
0answers
7 views

Problem with third party libraries css in rails 6.0 using SASS

I am trying to use jquery-ui datepicker in my ruby on rails 6.0 project, I installed it using yarn and in general it works, but I have a problem with the images (e.g. the arrows for passing months) I ...
0
votes
0answers
17 views

Rails Controller render json. I need to include nil values

I have the following models in my rails App. Lease Estate Contact Address class Lease < ApplicationRecord belongs_to :estate belongs_to :contact end class Contact < ApplicationRecord ...
-5
votes
0answers
19 views

Problem with database after domain change ruby on rails

After I changed domain name for a ruby on rails application and it was ok only the menu and other database information are not showing up. But it doesn't throw any error. There are some steps I must ...
1
vote
1answer
35 views

Select query in Ruby on Rails

I am new to ruby on rails but I am not finding the meaning of this line of code. I saw in the documentation of rails that select will build an array of objects from the database for the scope, ...
1
vote
1answer
26 views

HTTParty cannot get id of album

I'm building a rails app and I'm trying to grab some data from an API. This is my controller require 'will_paginate/array' class AlbumsController < ApplicationController def index @albums =...
0
votes
1answer
24 views

I get empty value in the params when I try to create join model

I'm creating a join model Invite for has_many through relationship with Party and Guest but I get empty params[:party_id]. The user is logged in as a guest and the guest can see all the party list, ...
0
votes
1answer
15 views

Can I inhibit logging parameters sent to a controller method?

The last step in one of my current projects is creating a Zip archive using Ruby's 'rubyzip' gem. To do this I create the contents of the archive, place those contents into a parameter called ...
0
votes
0answers
13 views

jwt token decoding even when wrong token is provided for some letters

I was just trying out jwt tokens on a rails app. Using this jwt library. http://github.com/jwt/ruby-jwt JWT.encode({sss: "333"}, 'SECRET_KEY') #returned below token "eyJhbGciOiJIUzI1NiJ9....
3
votes
2answers
35 views

Query on Params

I want to get records based on params received. Sometimes I receive 2 params or sometimes 3. I have written a code to get results when all 3 params received but when I receive only 1 param am getting ...
0
votes
0answers
18 views

ActiveStorage not persisting blob to attachment after Rails 6.0 upgrade

I have an issue with ActiveStorage that seems to have occured because of the Rails 6.0 upgrade (from 5.2.x). I have a custom admin interface where Pages have Fields, and each Field has an STI type ...
1
vote
0answers
20 views

How to include css stylesheet into wicked pdf?

I am stuck on the gem wicked_pdf. I am generating a pdf report and I want to include stylesheets. Stylesheets are generated through webpack with tailwindcss. In wicked_pdf doc, it is said that I ...
0
votes
0answers
19 views

I want to put the Rails application on reboot

I've Linux Server with CentOS 7 OS and I've installed the following application on it. 1) Rails 6 2) Ruby 2.6.3p62 My requirement now is that I want to put the rails application when starting the ...
0
votes
1answer
18 views

How do I get Jest to recognise JQuery in my Rails project?

I'm working on an originally-Rails-4-now-upgraded-to-5.1.6.2 app. We originally relied on Sprockets for our JS, but have now mostly migrated to Webpacker, and for which I want to start introducing ...
0
votes
0answers
5 views

Reload fields_for without postback from JQuery/Javascript

I've implemented dynamic product fields related to my product_type entity as described here http://railscasts.com/episodes/403-dynamic-forms In my product.form I have the following to dynamically ...
1
vote
1answer
28 views

Is it possible to generate a simple_form field out of a JSON response?

I'm searching for a way to create simple_form fields of all options belonging to a room_type, such that a user can fill in the option_quantity. The room_type is asked first in a form and consequently ...
0
votes
0answers
10 views

Logout out issue in staging envirnment for multipple users in rails app

We have a app which is deployed in staging and devror env. we have deployed with nginx and unicorn. if user will be inactive for 30 min we have set log out after 30 min if there there is no activity. ...
0
votes
0answers
12 views

Access Token From Pinterest API Not Being Returned Using Rails

In localhost environment/development, I am having trouble getting the access_token from pinterest (based on the authorization_code) in order to pull board and pin id's. Pinterest returns the code from ...
0
votes
1answer
43 views

Why ransack doesn't work with flutter chopper?

Can ransack work with flutter chopper? My flutter project using chopper to call api server, where the server side is written using Rails. service.dart @Post(path: "orders_list") Future<...
-2
votes
0answers
28 views

How do I access request body in rails api when using it with React in Frontend

So I am sending some data from my React Frontend to Rails Backend and I can access the data by using the syntax request.raw_post or request.body and the data which I can see in the console after ...
0
votes
0answers
11 views

Rails - Serialize collection with additional field

I use 'active_model_serializers' as serialization engine. By now by index method returns array or orders. render json: @orders, each_serializer: Web::OrderSerializer. Now I want to add additional ...
0
votes
0answers
19 views

Command “webpack-dev-server” not found with rails 6 and docker

I have a rails 6 app. I just did rails new to generate it, nothing else. These is my docker file: ARG RUBY_VERSION # See explanation below FROM ruby:$RUBY_VERSION ARG PG_MAJOR ARG NODE_MAJOR ARG ...
0
votes
0answers
45 views

How to start new Rails project with existing database?

I would like to start new Rails(v 6.0) project with an existing postgresql database on local machine. In order to move the data I used gem 'yaml_db' which dumped data from the existing db into data....
0
votes
0answers
13 views

How to make rails action cable work with angular 2/4/6/8? I'm losing authentication

I am trying to configure my action cable in rails with angular 2+ . So I used the ng2cable to subscribe to the backend as follows: Angular component Code this.ng2cable.subscribe( 'ws://...
0
votes
1answer
17 views

How to search data on created at less than in thinking sphinx

Using thinking_sphinx to fetch data from records. It working fine but facing an issue that not find any to get records on date comparison like created_at greater than or less than. I check their ...
0
votes
1answer
40 views

Active Record in_batches vs find_in_batches

I want to perform batch operations on millions of records from DB. According to the ActiveRecord documentation, there are two methods to perform batch operations, namely #find_in_batches & #...
1
vote
4answers
42 views

How to explicitly invoke an action used by a form in Rails 5.2?

My application contains a form allowing user to select a Playground object to work with. Choosing playground updates current user's current_playground_id field. Main elements are: routes.rb ...
0
votes
2answers
36 views

How to construct a query that checks if relation exists

I am building an Rails 5 app. In this app I got a User model and a Subscription model. I want to be able to get all Users that got an active Subscription. User has_one :subscription - id, - name - ...
0
votes
0answers
15 views

Ice_Cube Gem - validate if weekly/monthly/yearly

Im using Ice-Cube gem to generate schedules for Events and store them as a ical. I'm using a select field to choose between "daily", "weekly", "one_occurrence" and a number_field for the reccurrence ...
0
votes
0answers
9 views

Create Ads from published page post in Facebook

I want to create Ads by using Facebook Published page post. For this process, I'm able to get all Published Posts of a Page through graph API (page_id/posts). Also, I can create ad creative along with ...
1
vote
2answers
39 views

Try to update, if update fails then delete (RubyOnRails-PostgreSQL)

I am trying to, update a record, however if it fails due to unique validation, then I am deleting the record since the intended record is already present. def update_dependent_model(records, ...
-2
votes
1answer
29 views

Parsing a XML string with no sense of keys

I'm using OpenUri and RSS in Rails 5.2.3 and Ruby 2.6.1 to do this. I'm trying to parse WeWorkRemotely's RSS feed, however, they have one field description that contains all the information in a ...
0
votes
1answer
15 views

How to implement flatpickr when using cocoon in edit action?

I'm using the flatpickr calendar in a nested cocoon form. Everything functions as expected when creating a new form, but when I want to edit an existing form: The first flatpickr field renders ...
0
votes
0answers
19 views

Communication between a Rails app served by Nginx + Passenger and a Node.js app

How to communicate between two apps on one virtual host? node js app should send internal requests on rails app served by Nginx + Passenger. The actual result of request: ERROR [Axios] Response ...
0
votes
0answers
24 views

“.js is not present in the asset pipeline”

I know this is a very repeated question but I have done everything by the books, read a bunch of SO posts and none have helped so far....... assets.rb Rails.application.config.assets.version = '1.0' ...
0
votes
2answers
32 views

Error: bundle install failed for mysql gem

Sorry in advance for my bad English. I'm trying to install mysql in RoR, but when I try I have this error: Installing mysql2 0.4.10 with native extensions Gem::Ext::BuildError: ERROR: Failed to build ...
0
votes
1answer
19 views

jQuery Timepicker “changeTime” not working

I have included jQuery timepicker in my project, and I want to alert some value after a new time is selected/changed from the timepicker element. This is my code. _form.slim .form-group.col-md-6 ...
1
vote
0answers
14 views

Architecture for integration-testing a web extension with a web-server

I have a web extension whose functionality needs to be tested against a web server. The web extension is built using Webpack and should run on Chrome and Firefox. It has its own unit tests, but what's ...
0
votes
0answers
7 views

How do I handle master.key when creating rails assets while building docker image? [duplicate]

I attempt to create my RoR application as docker image, and I have trouble about handling master.key. When I do bundle exec rails assets:precompile RAILS_ENV=production while creating docker image, ...
1
vote
4answers
33 views

Rspec : is there a matcher to match array of arrays, not testing order

I try to test if two arrays of arrays contain same elements, without testing order of elements. (Rails 5.2 / Rspec-rails 3.8.2) exemple : [['a1', 'a2'], ['b1', 'b2']] [['b2', 'b1'], ['a2', 'a1']] I ...
0
votes
2answers
29 views

How to test “Model.valid?” on a FactoryBot generated model using Rspec?

I have created a Chatroom Model that first validates for the presence of some fields so in the controller I create the chatroom then check if it is valid by using the .valid? method to determine the ...
1
vote
1answer
29 views

Stub or mock instance method rspec

The below function is a controller action and gets the data to be served from an AWS S3 bucket. def show s3_response = Zlib::GzipReader.new(ApiBucket.bucket.object(id).get.body).read render ...
0
votes
0answers
19 views

SSL in PostgreSQL, do I need ssl_mode=require

I saw this StackOverflow How do I make Rails use SSL to connect to PostgreSQL? but I don't understand even if I set ssl_mode=require in staging how do I verify that it wasn't already negotiating a ...
0
votes
0answers
37 views

How to iterate over options belonging to filled in value?

In a reservation form, a user can fill in a room_type. Consequently, I would like to iterate over all options belonging to that room_type and let people assign a quantity for that option. Current ...
0
votes
0answers
15 views

How to debug / fix a Postgres db error in prod?

I have a simple site built with Rails running on Heroku. The production database is acting oddly; running a rake task over the Users table with User.find_each is returning a record that has been ...

返回首页
杏彩计划 杏彩官网 杏彩APP 杏彩走势图 杏彩下载 杏彩官方 杏彩网站 杏彩怎么玩 杏彩官方 杏彩靠谱吗 杏彩代理 杏彩骗局 杏彩投注 杏彩倍率 杏彩开奖 杏彩漏洞