Ruby on Rails Community Forum

How do I use nested blocks passed to a method? (metaprogramming?)

0
Ruby
Hi guys! So i am totally lost with something: I need a class that creates a pseudo xml output (only nodes). This class has a builder method (a class level method) which receives a block, and accord...
Miguel Ricardo Gomez posted

Unable to deploy TailwindCSS on a Rails 7 app to Heroku. Can someone please help me?

0
General
I'm currently trying to deploy my rails 6 application to Heroku. I'm not sure where the error is coming from since the styles work well on development but break when pushing to production. ...
Medves Larisa Viviana posted

CSRF logging me out

0
Rails
Rails 5, Ruby 2.7. I'm getting the dreaded error "Can't verify CSRF token authenticity." and I'm being logged out and my tokens don't seem to match. This is happening on a new development machine (...
Bruce Lulu posted

Rails 6, Webpacker and Docker on Apple M1

0
Rails
Hi Chris, I tried to leave a comment for episode #389 but was not successful. Not sure why. Anyway, I'm developing in Apple M1 and trying to dockerize a Rails 6 application, but running into a lot...
Gabriela Jack posted

Runaway Memory Leak/Usage with esbuild reload

2
Gems / Libraries
After watching this episode - https://gorails.com/episodes/live-reload-esbuild-rails - we implemented the live reload functionality across several of our apps. Overwhelming it's amazing! However,...
Craig Kaminsky replied
Solved

how i can implement this functionality

0
Rails
Seller can perform CRUD on his/her listing(product i.e laptop) Seller can upload multiple product images.
faheem ismail posted

JavaScript functions disappear when using Rails 7

2
Javascript
Hi, I'm using Jumpstart Pro with Rails 7 and feel very confused as to what's happening with my JavaScript functions. I have a Lessons view in which various buttons are used to play audio, switch ...
benjaminhouy replied

Using find_or_create_by with accepts_nested_attributes_for

7
Rails
Hi gang...I have a Book which has_many :authors, through: :book_authorsInstead of creating a new Author each time I create a book I'd like to use find_or_create_by on the author's name attribute. R...
Solved

Heroku Error - We're sorry, but something went wrong.

2
Rails
Hey Guys, I deployed my app to Heroku but I am getting the "We're sorry, but something went wrong. " so I ran heroku logs and this is what I got: ``` 2019-11-07T18:45:20.355498+00:00 app[web.1]:...

ActionController::UnknownFormat in MessagesController#create

3
General
Ran into this error in part 4 of the ActionCable group chat. What exactly am I missing? Schema looks fine same with MessagesController. ``` ActionController::UnknownFormat in MessagesController#...
Solved

How to solve this problem while installing ruby

0
Ruby
I am trying to install ruby using "asdf" and while installation i got this error. -------------------------------------------------------------------------------------------------------- BUILD FA...
RAJAT SHAHI posted

How to use Rails Request.js Discussion

4
General
Hey Chris, this looks like a great addition to rails and thanks for adding the turbo stream support! I'm working on an infinite scroll where at the end of the page a stimulus controller gets the n...

How do I take over an existing code base?

2
Tips
Hi, everyone. This is my first post here. I'm taking over an existing Rails 6 project that is in production (and that I haven't worked on before). There's a lot to think about :-) Has anyone compil...

How do i save a field in a separate table when using devise?

6
Rails
I am using devise for my users, during sign up i have an extra field i want to store in a different table in my Postgres DB. How would i go about storing this extra field? So a **company** `has_ma...
Solved

Date range option

0
Rails
Can any one tell me how to provide a Date Range option on one of the pages of my project???What changes needed to be done in index file and corresponding controller to show it?
vinit rawat posted

Provide sort option

0
Rails
How can i provide the sorting feature on all the pages of my project dashboard??
vinit rawat posted

How to get rid of a legacy app?

0
General
Hello, i built my first rails app 6 years ago and there is a lot of things I want to get rid of. The app is still running and actually generating revenue! But it is basically not maintainable anym...
Fabian Hallstein posted

Forcing a file to download instead of displaying in the browser

3
General
I've got a website where users can upload things such as a mp3 and the files are being stored on Amazon S3. If a user clicks the file it just seems to open as a streaming file in the browser. I c...
Chris Oliver replied

Enum in Models and Forms

1
Tips
I put together information I collected across different blogs, tutorials about how to use Enums in Models and Forms (focus on Rails 7). I might have missed some use cases, so feel free to comment ...
ghjuio replied
Solved

What are the pros/cons and considerations that should be taken in separating your mostly static front facing website from your web app in rails?

4
General
I am in the process of building a rails app and I am unsure if I need to separate my front facing mostly static website from my web application. I see lots of example of sites having there front fa...
ChristianThompson replied
Solved

Learning Ruby on Rails? Join our newsletter.

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