
How to stay strictly in Ruby ?
1
Rails
Hello, I'm a newbie at Rails. Let's say I have this simple form:
<%= form_for @article do |f| %>
<%= f.label :title %>
<%= f.text_field :title %>
<%= f.labe...

Attaching file to email Active Storage
1
Rails
Hi Guys,
I am trying to attach a pdf to an email via active storage. Here is my code below and the error I am getting.
class Assignment < ApplicationRecord
has_one_attached :upload
belongs...

ruby on rails nested model relationship and routes
9
Rails
I have these models: `Sport,` `Country,` `League` and `Match `
Also I do have `SportsController,` `CountriesController`, `LeaguesControlle`r and `MatchsController`
So the question is:
1: how i ca...

Why am I not getting any data inside the dropdown in browser?
2
Rails
My Controller has following code
`@select = Store.find(current_user.store_id)`
My View has:
```
<%= form_with(model:@store, local: true) do |f| %>
<%= f.select :id, options_for_select(@sel...

How do I set and use a default image with active storage?
3
Rails
If the User does not upload an image using active storage, how do I set a default image for that record?

NoMethodError in Contacts#edit
1
Rails
Hi all, I am new to Ruby as well as RailsI am working my way through a treehouse course and I have hit a bit of an obstacle.This is what my routes file looks likeRails.application.routes.draw do
...

How do i generate links like shopify does ****.myshopify.com ?
1
Rails
Hey, guys i wanna know how to generate a unique url foreach user but didn't know how to do it.#Stuck

Issue with inline-form from stimulus twitter example
2
Javascript
I have a rails 5.1 app that I am working the stimulus twitter example into. Instead of tweets they are going to be comments. The comments are linked to servicerequests. So on the servicerequest/sho...

How do I embed an internal routes/show page on to an external website?
1
Javascript
Hey all, I've seen websites where you place some Javascript code - and they are able to display information from another website on their website. Wondering how I can do the same? I have a www...

Upload image and send email without saving to the database
1
Rails
I recently tried to implement summernote to my rails app. I can send email and everything works fine. But I want to upload image and send the email, but the email received shows that the image was ...

URI::InvalidComponentError (bad component(expected scheme component): : https):
0
Servers
First of all, this problem is a persistent, and I'm trying to solve it for a week with 0 progress.I'm working on a Ruby on Rails website and using Devise and Omniouth-<social media> for authe...

How do i put Icon inside a text_field usind Rails and Slim
1
Rails
I'm new to Rails and even more to Slim. I need to put an Icon (i'm using Fontawesome icon) inside a f.text_field, but have no idea how.My code has: i.fa.fa-user.fa-2x
=f.text_field :name , p...

Portfolio responsive view not rendering on mobile Chrome; Safari
2
CSS
Hi, I was trying to figure out this Declaration dropped on a live webpage https://lb-webportfolio.herokuapp.com/portfolios in the Console. It is all fine on the localhost, however after d...

What is the best way to house view logic?
3
Rails
I have a view that is showing a list of steps. The steps are being pulled from the db with a status field.
There is a method that I've created that creates custom text based on the status, ie:
`...

Add image attachment to user post and server via AWS S3
3
Javascript
Hello.
I have a RoR 5.1 app, with an existing form that allows users to add a post to my app. However I want them to be able to include an image as an attachment. I'd like to save the image to S3...

Active Storage (Rails 5.2) vs Shrine
2
Rails
In the aplication, users have to upload files, I plan to use Amazon S3.
Do you recommend using Rails 5.2 Active Storage, or using the Gem Shrine as explained in Gorails?
What do you recommend?

How do I get all projects when the end date is exactly a weekly basis?
2
Rails
I have a project model with a start and end date.
I want to bring back all pojects that are exactly a week old, 2 weeks, 3 weeks etc
Is there a way to do this using a scope?
Thanks in advance

Database Relationship Structure (has_one and has_many together)
3
Rails
Hey Guys,
So I have a bit of a headscratcher here. I have a rails app which needs two relationships to what is the same table.
Basically, I have a Profile model. On that model I want to have one...

Best way to use common code for multiple applications ?
5
Rails
Hi all,
I would like to know the best way to use common code for multiple applications ? Basically I am working on two applications those two are build on top of third party APIs . I want...

Receiving incoming emails
5
Rails
I want to develop a software which has multiple emails against the brands, e.g Brand1 has email email1@gmail.com, email2@gmail.com, and Brand2 has emails email3@gmail.com, email4@gmail.com. So Cust...