Tumgik
maxcobmara · 13 days
Text
Tumblr media
0 notes
maxcobmara · 15 days
Text
Rail 5 -> 7 upgrade, now with importmaps
I held off upgrading my Rails 4 & 5 apps due to the knowledge hurdle that is Rails 6 with Webpacker.
I have finally taken the leap to upgrade to Rails 7, I have sort of made things work so far by ignoring all the Rails way of doing things and called JS & CSS via <script> tags in headers.
Some things work, and some things don’t and troubleshooting is starting to be a bit tedious.
My default way for Rails 7 is esbuild however I have decided to do it using import-maps which behind the scenes is what I am doing already, except organised the Rails way
So the first gotacha is that import-maps does import the js, but not the css, anyway assuming you’ve successfully upgraded from Rails 5 to Rails 7 and your app is running, lets install import-maps first.
add
gem 'importmap-rails’
to your Gemfile
run
$ rails importmap:install
do note the file created via console output namely
app/javascript/application.js app/assets/config/manifest.js config/importmap.rb
I haven’t upgraded to Bootstrap 5 yet on this app so..
now install (pin) Bootstrap 4.2.6
$ bin/importmap pin [email protected]
add the lines to your app/javascript/application.js
//imports the bootstrap js libraries import 'bootstrap'; //adds a popup so you know js is working alert('Hello World from ImportMaps')
your config/importmap.rb should read
pin "jquery", to: "https://ga.jspm.io/npm:[email protected]/dist/jquery.js" pin "popper.js", to: "https://ga.jspm.io/npm:[email protected]/dist/umd/popper.js" pin "bootstrap", to: "https://ga.jspm.io/npm:[email protected]/dist/js/bootstrap.js"
next for the css part. you could if you wanted to either use the CDN Bootstrap CSS, or add it locally, but we’re rubyists and want fast so we add the bootstrap gem.
gem 'bootstrap', '~> 4.6.2’ #because still using Bootstrap 4
$ bundle install
rename your app/stylesheets/application.css to application.old note the contents mine was *= require custom *= require bootstrap *= require_compiled *= require_self
create app/stylesheets/application.css and add the following lines
@import "bootstrap"; @import "custom"; @import "compiled";
Finally upgrade your app/views/layouts/application.html.slim
from = stylesheet_link_tag 'application', media: 'all' = javascript_include_tag 'application', 'data-turbolinks-track': 'reload'
= stylesheet_link_tag "application", "data-turbo-track": "reload" = javascript_importmap_tags
Should work, but what do I know
0 notes
maxcobmara · 1 month
Video
youtube
Ruby on Rails: The Documentary
I remember using rails 2.x to start with, by the time I was using in a professional was Rails 3.x.   I remember how Ruby just clicked, and how Rails just worked, it was like here is a framework+language that worked how my brain works.
It’s like coding telekinesis.
0 notes
maxcobmara · 1 month
Text
“I’ll do it when I get home and in front of a computer” is a genuine vibe.
Tumblr media
123K notes · View notes
maxcobmara · 1 month
Text
youtube
Great watch, a bit too much marketing speak but I think Polaris did a great job of bringing a great evolution to the existing Indian Scout.
1 note · View note
maxcobmara · 1 month
Text
Tumblr media
Had to power up my first pokemon to max CP for level 47 quest, and blazed through stardust, and now I feel sick, and want to go home and curl up in a ball.
0 notes
maxcobmara · 1 month
Text
Tumblr media
My first car was a Peugeot 305SR 4sp that I bought off my dad, my dream car growing up was a 306 cabrio. Achievement unlocked.
0 notes
maxcobmara · 1 month
Text
Tumblr media
Picked up the scout with newly fitted Ohlins today. Night and day
0 notes
maxcobmara · 1 month
Text
Tumblr media
0 notes
maxcobmara · 2 months
Text
I really do love pininfarina peugeots
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
Peugeot 504 cabriolet Pininfarina. - source Victor Dos Santos.
130 notes · View notes
maxcobmara · 2 months
Text
So I was ordering pizza, and wasn't sure which deal was actually a deal. The omni-calculator definitely helped me decide. I'm glad humans work on things like this, small helpful tools help drive civilization forward.
0 notes
maxcobmara · 2 months
Text
Tumblr media
0 notes
maxcobmara · 2 months
Text
I almost bought one of these, found it for sale, and took me two days to put the cash together, I drove to the guy and as I was arriving watched it leaving to the new owner.
Tumblr media Tumblr media Tumblr media
1974 Lancia Beta Coupé
My tumblr-blogs:
www.tumblr.com/germancarssince1946 & www.tumblr.com/frenchcarssince1946 & www.tumblr.com/englishcarssince1946 & www.tumblr.com/italiancarssince1946 & www.tumblr.com/japanesecarssince1947 & www.tumblr.com/uscarssince1935
39 notes · View notes
maxcobmara · 2 months
Text
Tumblr media
Chiang Mai old fort city deserted.
0 notes
maxcobmara · 2 months
Text
Ok just need to shout out to ThoughtBot for producing this series where they take an app from Rails 3.2 to Rails 7. Many of the pitfalls that they went through happened to me to, where I finally gave up and followed a long with my own app and resolving issues along the way in a similar fashion. I used to take the hard route and actually just rewrite the application when things got too difficult, but this actually got me through it.
0 notes
maxcobmara · 2 months
Text
Thought I'd find a thing that can randomly select an image from photos and post it to a chosen socmed. Nothing free. I'll learn swift for this
0 notes
maxcobmara · 2 months
Text
Was really hesitant about upgrading Rails 5 apps to Rails 7 due to my intense dislike for Rails 6. I understand what it was trying to do, but it was uncomfortable for me, and I was always wresting with yarn and webpacker.
Maybe I just need to get out of my comfort zone more. Now I'm looking forward to this end of contract.
0 notes