The goal is to eliminate Node.js (including jsbundling and cssbundling) as a dependency when using tailwindcss-rails.
The approach involves downloading and bundling DaisyUI once, allowing Tailwind CLI to handle the rest of
The goal is to eliminate Node.js (including jsbundling and cssbundling) as a dependency when using tailwindcss-rails.
The approach involves downloading and bundling DaisyUI once, allowing Tailwind CLI to handle the rest of
This guide will walk you through adding a ChatGPT-like messaging stream to your Ruby on Rails 7 app using ruby-openai, Rails 7, Hotwire, Turbostream, Sidekiq and Tailwind. All code included below!
Want more content like this, for free? Check out my free book, RailsAI!
def search_result
categories.each_with_object([]) do |category, keywords|
keywords << category.keywords.split(', ').select{ |c| c.include?(query) } unless category.keywords.blank?
end.flatten.tally.first(3).map(&:first)
end
[1, 2, 2, 3].tally
# set ruby/rails version | |
export DOCKER_RAILS_VERSION="7.0.1" | |
export DOCKER_RUBY_VERSION="3.1.0" | |
export RAILS_PROJECT_NAME="rails7" | |
# create folder for the project and add Gemfile with necessary rails version | |
mkdir "$RAILS_PROJECT_NAME" | |
cd "$RAILS_PROJECT_NAME" | |
echo "ruby '$DOCKER_RUBY_VERSION' | |
source 'https://rubygems.org' | |
gem 'rails', '$DOCKER_RAILS_VERSION'" > Gemfile |
Note: Before diving into this implementation, consider that there are more popular and potentially easier-to-use solutions for implementing Sign in with Apple in Ruby on Rails, such as Omniauth. If you prefer a more out-of-the-box approach, explore those alternatives.
This implementation of the Sign in with Apple service in Ruby on Rails is suitable for APIs, eliminating the need for views.
(from : https://simplifiedthinking.co.uk/2015/10/03/install-mqtt-server/ ) | |
Installing Brew | |
The Mosquitto MQTT Server can be easily installed using Homebrew. If it’s not installed on your system already, then a quick visit to the homepage will give you all you need to get going. Homebrew is an OS X Package Manager for installing and updating non-Mac OS X utilities that are more commonly found in other variants of Linux. To install the basic package manager run the following command. | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
Installing Mosquitto MQTT |
module ActiveAdmin::ViewHelpers | |
include ApplicationHelper | |
def show_image(p) | |
p.object.image.nil? ? p.template.content_tag(:span, "No Upload Image Yet") : p.template.image_tag(p.object.image.url(:small)) | |
end | |
end | |
module ActiveAdmin | |
module Views | |
class Footer < Component |
# include from an initializer | |
module HstoreAccessor | |
def self.included(base) | |
base.extend(ClassMethods) | |
end | |
module ClassMethods | |
def hstore_accessor(hstore_attribute, *keys) | |
Array(keys).flatten.each do |key| |