- You MUST NOT try and generate a Rails app from scratch on your own by generating each file. For a NEW app you MUST use
rails new
first to generate all of the boilerplate files necessary. - Create an app in the current directory with
rails new .
- Use Tailwind CSS for styling. Use
--css tailwind
as an option on therails new
call to do this automatically. - Use Ruby 3.2+ and Rails 8.0+ practices.
- Use the default Minitest approach for testing, do not use RSpec.
- Default to using SQLite in development.
rails new
will do this automatically but take care if you write any custom SQL that it is SQLite compatible. - An app can be built with a devcontainer such as
rails new myapp --devcontainer
but only do this if requested directly. - Rails apps have a lot of directories to consider, such as app, config, db, etc.
- Adhere to MVC conventions: singular model names (e.g., Product) map to plural tables (products); controllers are plural.
- Guard against incapable browsers accessing controllers with `allo
# frozen_string_literal: true | |
module Router | |
class << self | |
include Rails.application.routes.url_helpers | |
def default_url_options | |
Rails.application.config.action_controller.default_url_options || {} | |
end |
# The Rails ActiveSupport core extensions provide additional | |
# functionality to any Rails or Ruby application. | |
require "active_support" | |
# ActiveSupport#blank? | |
nil.blank? # => true | |
false.blank? # => true | |
{}.blank? # => true | |
[].blank? # => true | |
"".blank? # => true |
<div id="wrapper"> | |
<form id="paper" method="get" action=""> | |
<div id="margin">Title: <input id="title" type="text" name="title"></div> | |
<textarea placeholder="Enter something funny." id="text" name="text" rows="4" style="overflow: hidden; word-wrap: break-word; resize: none; height: 160px; "></textarea> | |
<br> | |
<input id="button" type="submit" value="Create"> | |
</form> | |
</div> |
By Ira Herman
Live Video Walkthrough (bonus lesson) recording
================
Session Format: Talk
White-boarding is not nice. An unpaid take home project is not nice. We decided to apply the Ruby community motto "Matz is nice and so we are nice," to our enterprise technical interview process. Come learn what changes we made, how we enlisted support of other rubyists and non-rubyists alike, and how you can too.
The current state of interviewing is not nice
- Website: https://stimulusjs.org/
- GitHub repo: https://github.com/stimulusjs/stimulus
- Handbook: https://stimulusjs.org/handbook/introduction
- Discourse: https://discourse.stimulusjs.org/
initialize
: once, when the controller is first instantiatedconnect
: anytime the controller is connected to the DOM
In your command-line run the following commands:
brew doctor
brew update
Open terminal and run the follow command to install the latest version of Homebrew. This will also install the XCode utils if you don't have them already installed.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"