Ruby on Rails Community Forum

How do I add a conditional snippet of page specific javascript (likely a turbolinks issue)?

4
Javascript
Here's to hoping I can be clear and concise about my problem. I am willing to venmo/paypal a beer's worth of cash to anyone who can help me 🍻 I currently have a bootstrap (3.3.7) modal that is, by...
Peter Marcano replied

Changing currentTime of video in Rails webpacker-react component

0
Rails
So I was able to put a react component in a [sandbox][1] and get it working as I wanted. In isolation it just manages the currentTime of a video. In the main app clicking a button changes the state...
gjaros posted

How do I handle Koala error

2
Rails
After watching [Facebook API and Auth Tokens with Koala](https://gorails.com/episodes/facebook-api-and-auth-tokens-with-koala), I decided to implement it. However, I made a mistake in my logic and...
Alexey replied

taking values from associated values

0
Rails
t1->t2->t3 . taking values of t3 in t1
Abhishek Aravindan posted

How do I convert a SQL query to rails?

0
Databases
Hi, I'm new to ROR. The query I created below is functioning properly. I'm trying to prepare an interrogation. But I didn't succeed. The query is as follows; @rad_check.tenant_id = SELECT groupn...
Emrah Yıldırım posted

Check a user is author of post before edit or delete

2
Rails
Hi all, What is the best way to check a user (current_user) owns a post before edit or delete? I have a Post model with a has_one relationship to the User model, user_id is set. The logged in use...
Philip Benton replied
Solved

Searchkick Elasticsearch filtering

0
Rails
Does anyone know of any good tutorials showing how to add filters for searching? Thanks in advance.
Stephen Sizer posted

How do I properly handle submit events in Vue + Rails?

1
Javascript
Hi! I'm learning Rails, Vue and JS and I've got a question on the proper handling of submit buttons on Rails using Vue component to validate it. I'm using mdbootstrap for the styles. I built a fo...
olidev replied

Loosing my attached_images when cap deploy after switching my path so that my posts stay

1
Databases
Okay one last question :) To avoid that cap production deploy is killing my Posts from the database i added production: adapter: sqlite3 database: /home/deploy/apps/Blogapp/releases/shared/d...
Sebastian replied

How do I access google apis from a cron job?

0
General
My requirement: My cron job (a ruby script) would sync specific contacts between 2 google accounts. Eg: Account A creates a contact in his (android) phone as "Lead John". It gets saved in google ...
Prasanna N posted

Switching from Sqlite3 to MySql or Postgresql and how

2
General
I now have the problem that whenever I deploye something with capistrano my Sqlite3 database disappears. I have already read that it is in a different folder or that there are problems with it. No...
Sebastian replied
Solved

Rails 5.2 Credentials

2
Rails
Me again :) Question about the new credentials in 5.2... I've upgraded to 5.2 and actually really like credentials but wondering. Is it now the place to store all sensitive information including ...
Philip Benton replied

How do I .... And why should I... event source my application :)

1
Rails
Hi Chris, Would be nice to see a video about event sourcing, and what approach would you take: - https://github.com/fhwang/event_sourced_record - https://github.com/RailsEventStore/rails_event_st...
Chris Oliver replied

Custom Validations Issue

6
Rails
I have a custom validator that I would like to protect some data on my Users to Sites has_many through relaitonship. There is one extra piece of data on the `sites_users` join table `is_default` w...
Thomas Bush replied
Solved

Bundle Package and Deployment

10
Rails
Hi all, New user to the Gorails site, what a fantastic resource! I'll be upgrading to Pro shortly. I have a first question (probably of many)... I am deploying my app with Capistrano and it work...
Chris Oliver replied

Iam desperately trying to deploy my App with Capistrano but it isnt working

2
Rails
Hey Folks, I have always received great help here, so I hope that it will work out this time so shortly before the end. I would like to deploy my app on my server and use capistrano. However, I c...
Sebastian replied
Solved

Missing `secret_key_base` for 'development' environment, set this value in `config/secrets.yml`

2
Rails
Hi, im newie with Ruby and Rail. Right now im following Book Two from Daniel Kehoe. I stucked with SECRET_KEY_BASE. Ruby -v : **2.4.1** Rails -v: **5.1.6** After I restart Puma: Puma caught ...
CodeParody replied
Solved

Inheritance is not working.

1
Ruby
Hi, I'm a starter in ruby, I have a doubt in Inheritance in ruby. This is my sample code. ``` class TimeLine attr_reader :tweets def initialize(tweets=[]) @tweets = tweets en...
Jacob Montgomery replied

How do I write the correct association?

0
Databases
If I wanted to have a "user_type" column in my "users" table that references to another table called "user_type", how do I write the correct association in rails? For example if my user_type is 1 a...
Arzee posted

How do I query a model with a value less than

2
Rails
I have a Lesson model that has an order field of type integer. What i want to do is find the previous lesson. Lesson.where("order < ?" , 8) This causes the following error. Any help woul...
Chris Oliver replied

Learning Ruby on Rails? Join our newsletter.

We won't send you spam. Unsubscribe at any time.