How to create many subcategories in rails?
1
Rails
Without using any gems how do I do this in rails? I see the gem Ancestry (https://github.com/stefankroes/ancestry)
```
Main Category
Sub Category
Sub Category
Sub-sub Category
Main Category
Su...
Solved
Configure Redis Session Store
0
Rails
Seems pretty straight forward however, I am getting an invalid authenticity token error upon form post with my app.
Here's what I have set in config/environments/development.rb:
```
config.sessi...
Derek Dyer replied
Solved
simple_discussion gem vs. discourse for lightweight forum
3
Gems / Libraries
Just checked out the simple_discussion gem (extracted from the GoRails forum here). It looks like exactly what I need for a small forum project.
I'm wondering if anyone else has used the gem in p...
Chris Oliver replied
Solved
Best way to create a belongs_to object from a has_many
19
General
Sorry for the vague title but I cant think of a better explanation! Let's say I have a list of Users and an admin could click a button/link that would create a site for them from the existing ...
alangosh replied
Solved
How to create new contacts from nested attributes form
7
Rails
I'm building my first semi "real world" rails app (an Open House management app for real estate). I am currently stuck on a "accepts nested attributes" problem. Here are the details... (I've provid...
LucyHills replied
Solved
I'm lost and can't find the way out
18
Rails
So I'm in the middle of this project and I thought I could figure it out on my own, but it appears I am in over my head here. So any advice/help you can give me would be great.
Basically I'm tryi...
Andrea Fomera replied
Solved
Controller naming...
3
Rails
Evening all,
So i have a question about naming controllers. Which would be best to use? MyOrder or MyOrders
Is it just the DB which get pluralised?
Alan Reid replied
Solved
has_and_belongs_to_many associations
6
Rails
Im building an app where a `User` belogns to several projects. Is this a good approach to create a "join table" that just tracks which `Projects` are connected to which `Users`? Is the `Collaborati...
Lauro replied
Solved
How do I build a multi step wizard in ruby with StimulusJS
6
Ruby
Hi GoRails,
I would like to make a multistep wizard in ruby on rails without making use of the wicked gem. Just stimulusJS and ruby :)
Could you make a tutorial about that?
Thanks in advance!
Fatih replied
Solved
How to count comments like reddit (infinite nested model) ?
2
Ruby
Hey Chris,
I have an `item` model which gets submitted. With
`has_many :comments, as: :commentable, dependent: :destroy`
then in the `comment` model I have
`belongs_to :commentable, polymorphic...
Solved
URL Based multi tenancy
10
General
I'm new to Ruby on Rails, trying my best to catch up. for example... i've a domain and a username append to it, www.domain.com/samsoft, how can i achieve this and also routing? sample code will be ...
Chris Oliver replied
Solved
Commontator with Trix
3
Gems / Libraries
Good day robots,
I'm trying to implement the Trix editor as the default editor for Commontator's comments.
The default Commontator view is defined as follows in `app\views\commontator\comments\_f...
Solved
What is the best way to add a dynamic active class to a link with Tailwind CSS?
6
CSS
From what I understand the "active variant" is not enabled by default? Where exactly do you enable that with rails? Is there another way to add and remove parts of classes to put together an active...
Solved
Dynamically create sass variables in rails
6
CSS
I have a multi-tenant app where each tenant can set their primary and accent colors. Is there a way i can grab those values and insert them into a sass file on page load? I"m using rails 5 and post...
Matt Taylor replied
Solved
Using React
19
Rails
I'm trying to learn how to use react in my rails 5 app.
I've just finished following Kenny Hibino's you tube series for his medium clone. He used react-rails gem, but then realised he wanted to u...
Rio replied
Solved
API
2
General
Hi everyone,
I have recently set on a mission to learn more about APIs. I get some data from a external JSON API but have come a cross an issue that I need some help with.
I’ve defined my cars v...
Solved
How do I create an attendance form for student attendance?
9
General
I've been racking my brain and just need to ask for help on the creating this function in my app.
**Scope:** simple app for non-profit for tracking student attendance
What I've done:
* created the...
Solved
Extend Sprockets to bundle mustache templates
3
Rails
I'm trying to include some Mustache templates into the main JS bundle. The idea is to take `/app/templates/*.mustache` files, generate a JSON object, and set a window-level variable, like this:
``...
Solved
Format of created_at for date range using Searchkick
12
Rails
I am using searchkick to build out a searchform that has a couple different parts to it and searches across multiple models. I am specifically trying to get a date range setup so the user can searc...
Chris Oliver replied
Solved
Got error message when I install Capistrano, stuck at deployment for two days.
23
Servers
I spent 2 days followed "Deploy Ruby On Rails onUbuntu 18.04 Bionic Beaver" , tried to deploy my rails project, now i'm out of my mind! I have repeated whole process for more than 4 times, always ...
Solved