This setup adheres to JavaScript Standard Style; unfortunately due to conflict between standard
's ruleset and Chai assertions, we have to acheive this by using eslint
directly + the Standard rules. Since we can't use standard
directly, we also throw in Prettier for code formatting. Specifically, we use prettier-standard to keep all of the pieces working together nicely. What's that mean for you? Well, here's the scoop on setting up a few editors for linting/formatting fun.
// Annotated Code -- CRUD with Rails-React | |
// Functions we get from the React framework will be marked with -> R! | |
// to get the full repo: `$ git clone git@github.com:applegrain/ideabox-react.git` | |
// https://facebook.github.io/react/docs/thinking-in-react.html | |
// Good read to get into the React state of mind | |
// Create a new dashboard component. | |
var Dashboard = React.createClass({ |
- add route for
new_user_path
- create a
UsersController
with new action - create
new.html.erb
- generate user model with
password_digest
string field - uncomment
gem 'bcrypt'
in Gemfile and addhas_secure_password
in User model - add
create
action in UsersController - implement logic for creating a user
- set
session[:user_id]
in create action
This is the notes we made while going through 1505's Object Model at Turing School. Unfortunately, we lost an hour and a whiteboard during Object Model 1, and had to change venues. Fortunately, we got to drink, and I got the first bit recorded.
A while back I made this quiz. I've completely changed the material since I gave this, but the takeaways are still the same.
Command Line
pry -r ./config/app_init_file.rb
- load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb
- load your rails into a pry session
Debugger
Originally published in June 2008
When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.
To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.
Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |