AstonJ
Phoenix for Rails developers
Do you know Ruby on Rails? Did you come from Rails?
If so do you have any tips to share? Was there anything that helped your grok the similarities/differences? Any articles, books, talks/vids/screencasts, or courses (or even forum posts) you found particularly helpful?
Most Liked
travisf
I’m likely not the best person to respond to this, Ruby & Rails was my first foray into development. I’d been doing Ruby stuff for about 3 years but my first real job as a developer was with Elixir. As much as I love Ruby, the Elixir world felt pretty much the same but everything was demystified. No special magic going on under the hood, if I wanted to know how something worked I could just go to the module/function and find it.
Admittedly, this was most frustrating moving from ActiveRecord to Ecto, I missed all the out of the box magic ActiveRecord provided.
I think https://elixircasts.io/ was a big help when I was first learning Elixir (it still is sometimes). My office also had an older copy of Programming Phoenix I worked through a few chapters of.
cjbottaro
I’ve been doing Rails since 1.x. I like to tell people new to Phoenix that it’s most like Rails 2.x. Kinda back when Rails was simple (routes that sends requests to a controller/action, and also the whole “restful resources” thing).
That said, I’m also starting to fall more and more into the camp of everything should be LiveView; there’s no point in doing controller/actions anymore (aside from APIs), even if you’re just making basic CRUD pages. Even beyond no point, I actually think it’s easier to make basic CRUD pages in LV now.
To get people’s foot in the door with LV, I do a 10 min live coding session where I make a route, then setup a basic LV and show how to do assigns and wire up the HTML, etc. Then try to show the difference between connected? mount and dead mount and how it relates to progressive loading.
sodapopcan
Ignore any notion you got that “Elixir is Erlang for Rubyists” If you are coming to Elixir from Ruby, wipe this sentiment from your brain. Elixir merely takes the syntactic elements from Ruby that Rubyists love and brings them to Erlang (by which I mean the BEAM, of course)—that’s it. The similarities end there. Seriously. The quicker you accept that the quicker you’ll make progress. At least that’s how it was for me.
In terms of Phoenix, for me it was to accept that Phoenix is nowhere near as opinionated as Rails is. That one actually took me a while. Phoenix is looking a lot less like Rails these days so this isn’t as much of a thing. You can, however, bring the spirit of those concepts over to Phoenix to great effect, however, my second piece of advice here is don’t get frustrated and try and jam specific Rails concepts into Phoenix. Just be uncomfortable for a few weeks and learn why things are the way they are, then you can break the rules if you see fit.
In terms of Ecto, it can be tough at first, but if you ever worked on a Rails project where a bunch of arel or raw SQL was necessary, Ecto will be a breathe of fresh air. I tell my Rails buddies that Ecto is “…like an actually good version of Arel” (sorry Arel devs, but it’s how I feel). I personally don’t miss ActiveRecord even a little.
Last Post!
egeersoz
It has been years since I wrote any Ruby code, but one thing I do miss to this day is being able to do stuff like 1.day.ago to get a date object that represents yesterday. Coding patterns/structures that resemble natural language are such a simple yet powerful concept that I’m surprised more languages haven’t tried to implement them.
Popular in Discussions
Other popular topics
Latest Phoenix Threads
Chat & Discussions>Discussions
Latest on Elixir Forum
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









