How do I add elm 0.19.1 to a Rails 6 application (with webpacker)? - ruby-on-rails-6

I found a very good tutorial on how to do this in a Rails 5.1 app (https://thoughtbot.com/blog/elm-and-rails-sitting-in-a-tree), but with the new folder structure in Rails 6 I'm confused.
Where do I put the Elm Main.elm-file? How do I setup webpack(er) to correctly integrate the elm-code into my packs/js-bundle?

bundle exec rails webpacker:install:elm
works even if the documentation for webpacker v6.x.x no longer provides information on the integration of elm.

Related

Class Drupal\twig_tweak\Twig_Extension not found in Drupal 10

I'm developing a website on Drupal 10 and I need the module Twig Tweak to be installed and working in order to use drupal_entity() in templates.
I copy-pasted the module from the /modules directory of another website powered by Drupal 8.9 and changed the line core: 8.x in the twig_tweak.info.yml file to core_version_requirement: ^10
But when I run the new website powered by Drupal 10 on the browser I receive the error
Class "Drupal\twig_tweak\Twig_Extension" not found in include() ...
This error is not thrown on Drupal 8 and 9 - only in Drupal 10.
How to resolve the issue?
The version of the module you are using is incompatible with Drupal 10. Some methods get deprecated, so the core compatibility strategy (update only the yml files) will not work for all cases.
You should download the module via composer
composer require drupal/twig_tweak
This is the recommended way to work with contrib modules. If you have any custom code on it, you should patch it.
Here is some info about patches
https://www.drupal.org/docs/develop/git/using-git-to-contribute-to-drupal/working-with-patches/making-a-patch
If somehow you can't use composer, try to download it from the module page. And check the core compatibility.
https://www.drupal.org/project/twig_tweak

Can someone tell me can i use angular 6+ with meteor 1.7?

angular meteor documentation is showing support for angular version 4.4. Is it depricated.
It works perfectly fine. I’m currently using the release candidate for meteor 1.8, angular 6.1 and the angular meteor driver 3.2 (I think)
All play nicely together. Look at the angular meteor repo and there are example apps. You can use the meteor command line version is you are used to meteor. I cannot comment on using it without the meteor command line as I do not use it this way.

Specific Angular 2/4 & Meteor quickstart/tutorial?

I've been all over the Meteor and Angular-Meteor websites (and Angular-Meteor github) looking for a pure Angular 2/4 guide to using Meteor (all I can seem to find is an Ionic one). Kind of confused as to how to use the CLI's together. Does anyone have a tutorial or know the steps to setting this up without Ionic? Or should I just be trying to follow the Ionic tutorial but using Angular CLI instead?
For anyone who is interested.
I spent most the day trying to use https://github.com/Urigo/angular-meteor with my app (used the quickstart), copied most of my apps src into the clients/imports directory and tried to keep the same app structure as the one on github, with a bit of messing around was able to get the angular bit working however if you are planning on using #angular/material, especially with a custom theme then you're in for a world of hurt (quite a few issues and comments re importing scss mixins from node_modules on the meteor github, meteors build system doesn't seem to like it).
To make it all work properly, follow the steps in The process I've done to recreate this section at https://github.com/Urigo/angular-meteor/examples/angularcli-meteor
If you already have an angular 4 app partially built then start in your apps root directory at step 3 (ng eject).
Instructions are fairly straight forward. Any steps where there isn't code examples (Now we need to create api/tsconfig.json) copy the file in question from the repo.
Hope that saves some others a heap of time.

De facto structure or template for spring mvc

I have started learning spring framework and I could get my way around it by referencing several example and templates.
But still I'm clueless how to start a spring mvc project from scratch. How would be the structure like ? If I were to choose XML based configuration or Annotation based configuration.
Any reference or suggestion would be helpful.
EDIT:
I'm using maven and trying to deploy with jetty. It would have been nice if archetype generate had a template for spring mvc.
There are some spring plugins available to generate project but still its a bit confusing because it varies between IDE.
NOTE:
spring-boot sort of frameworks are simpler. But I'm interested just plain old spring.
Download and run this example showcase of mvc features.
Run this in command line
$ cd spring-mvc-showcase
$ mvn tomcat7:run
Refer to this Spring`s Getting Started guide

Temporary scaffolding on rails 3

I'm new to rails and I'm actually reading a tutorial on it but unfortunately it's a very old one (2007). They talk about temporary scaffolding which is a one-line addition to a controller for example:
class StoryController < ApplicationController
scaffold :story
end
I tried it in my project but I'be got this error:
Routing Error
No route matches [GET] "/story"
Try running rake routes for more information on available routes.
I thought maybe it's because I'm running a different rails version, maybe the syntax have changed... So my question is how do we perform temporary scaffolding on rails 3.
I previously had to set config.assets.enabled to false because I had a route error.
I'm running under:
Rails 3.2.13
Windows 8 pro 32-bits
I'm very surprised to see this, because I wasn't around when Rails had this scaffold method you show. I've never heard of it before.
I searched the API documentation (and Rails source) and there is nothing like this now. Instead, there is the rails generate scaffold command. You can find more information at http://guides.rubyonrails.org/command_line.html.
As a suggestion: If you want to use a version of Rails from 2007, the tutorial you have now is fine. If you want to use a modern version, find a modern tutorial. The Ruby on Rails Guides site is good.

Resources