cjilbert504

Joined

7,630 Experience
76 Lessons Completed
0 Questions Solved

Activity

Posted in How do I search Action Text with Ransack?

I'll share what I did today to solve for this, which is really close to what Ryan did. The model, among other attributes, has a title and a rich text description like so:

has_rich_text :description

I wanted to be able to search across both attributes. I had the title one worked out already but to get the rich text description into the mix I then added the following line:

has_one :description, class_name: 'ActionText::RichText', as: :record

Which then allowed me to do this in the form:

f.text_field :title_or_description_body_cont

Hope this adds to the help that was already here and thanks to the other folks who contributed to this thread!!

Now wait a second why didn't you have to use the gem build and gem install commands before including the gem in the gemfile??

Posted in Symbols vs Strings Discussion

So the confusion that I have around all this is where is the link between before_action :set_project and def set_project? Like how does it know that the symbol :set_project is referring to the method set_project defined elsewhere?

logo Created with Sketch.

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

© 2022 GoRails, LLC. All rights reserved.