Gerard Donnelly

Joined

1,760 Experience
0 Lessons Completed
2 Questions Solved

Activity

Posted in Devise is driving me crazy

I solved this. I had a default port in my environments.rb file and then localhost was also being declared in my developments.rb which was causing a conflict as it was using port 465 in dev.

Posted in Devise is driving me crazy

Hi Guys,
Please can someone help me. I have set up sendGrid with devise. I have followed numerous tutorials and done everything correct but after a user signs up the log file site with the following lines:

 Rendering devise/mailer/confirmation_instructions.html.erb
 Rendered devise/mailer/confirmation_instructions.html.erb (Duration: 0.4ms | Allocations: 91)
Devise::Mailer#confirmation_instructions: processed outbound mail in 3.7ms

After what seems like an enternity the actual page redirects on the front end and the log updates with the following. If you look at the Delivered Mail line and the Message ID they contain some crazy random email address with my Macbook name.

Delivered mail [email protected] (60180.2ms)
Date: Wed, 18 Mar 2020 21:34:28 +0000
From: [email protected]
Reply-To: [email protected]
To: [email protected]
Message-ID: <[email protected]>
Subject: Confirmation instructions
Mime-Version: 1.0
Content-Type: text/html;
 charset=UTF-8
Content-Transfer-Encoding: 7bit

<p>Welcome [email protected]!</p>

<p>You can confirm your account email through the link below:</p>

<p><a href="http://localhost:3000/users/confirmation?confirmation_token=bJiYjwaRVzvbDPc7F9Y4">Confirm my account</a></p>

Redirected to http://localhost:3000/verify
Completed 302 Found in 62111ms (ActiveRecord: 75.1ms | Allocations: 33693)

If anyone could help me with this I would be so greatful. Its cost me a day and half so far.

Thanks for your help in advance.

Thanks,

Gerard

Posted in Setting background image from User uploaded asset

Hi Chris,

Thanks for your help on this. I eventually got it solved. The following worked:

style="background-image: url(<%= rails_blob_url(@creator.header_image) %>)"

Thanks,

Gerard

Posted in Setting background image from User uploaded asset

Hi Chris,

Thanks for taking the time to help me. The funny thing is there is an image attached. If I just add the image tag on the page it loads fine:

<%= image_tag(@creator.header_image, style: 'width:100%') %>

Posted in Setting background image from User uploaded asset

Hi Chris,

Weird. I tried your solution but still no luck. See image. I am using active storage. See image of error. "The asset "" is not present in the asset pipeline."

[img]https://i.imgur.com/7fpogii.png[/img]

If I just add it to a div on the page to test, it will show up.

Posted in Setting background image from User uploaded asset

Hi,

I am trying to set a user uploaded image as the background for their profile but cant seem to get it working. I'm stuck on what way to reference the image in the background css style. I'm using Rails 6.

style="background url('<%= image_tag(@creator.profile_image) %>')"

style="background url('<%= @creator.header_image %>')"

Any help would be greatly appriciated.

Thanks,

Gerard

Posted in Is there a acts_as_taggable gem that works on Rails 6?

The acts_as_taggable gem only supports upto rails 5.

Appologies if this is a stupid question.

Thanks,

Gerard

Posted in Flatpickr with "Present" value as well.

Thats a great help Chris.

Thanks.

Posted in Flatpickr with "Present" value as well.

Thanks for your explanation Chris.
To confirm.

Have 3 fields:
Start Date - Date Field
End Date - Date Field
Currently Working - Boolean

If Currenly Working (Boolean) is true; hide End Date field and clear any value from it.

Thanks,

Gerard

Posted in Flatpickr with "Present" value as well.

I am currently adding date ranges for jobs in my app. I want the user to pick the start and end dates using flatpickr gem. I also want the user to be able to set the field to "Present" if they are still working there. I was wondering what the best way to implement this would be.
See the screenshots from how LinkedIn do it.

[https://imgur.com/a/Jj1zoTL]

Thanks for your help guys.

Posted in Bootstrap class on individual tags in tag list

Hi Guys,
I am using the "acts as taggable on" gem and it's working perfectly. The issue I'm having is trying to style the individual tags in the list. I have the code below but it applys the pill style to the entire list rather than each tag. I have tried applying it to the "t" in the loop but its not working. Any help would be appriciated.

<%= raw article.tag_list.map { |t| link_to t, tag_path(t) }.join(', ') %>

here is what this is showing.

http://i65.tinypic.com/30bmz9w.png

Thanks for this explanation Umar, I will test it out and let you know how I get on.

Thanks,

Gerard

Hi Guys,
I have an artist model and I want users to be able to follow them without being followed back. Is there a gem that I can use to do this and is there any documentation on setting that up?

Thanks in advance for any advice.

Gerard

Posted in Symbols vs Strings Discussion

Great video Chris. Would love to see one on relationships such as has_many :through and Polymorphic.

logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2020 GoRails, LLC. All rights reserved.