- 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 newfirst 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 tailwindas an option on therails newcall 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 newwill 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 --devcontainerbut 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
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | ### Keybase proof | |
| I hereby claim: | |
| * I am lonbaker on github. | |
| * I am lonbaker (https://keybase.io/lonbaker) on keybase. | |
| * I have a public key ASCUMW6Pw9uM_opLGdpz_NCqjeLmKlA2ItKgR9Geh-JOdgo | |
| To claim this, I am signing this object: | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | set theURLs to {} | |
| set Urls to paragraphs of (read POSIX file "/Users/lonbaker/Desktop/Urls.txt") | |
| repeat with nextLine in Urls | |
| if length of nextLine is greater than 0 then | |
| copy nextLine to the end of theURLs | |
| end if | |
| end repeat | |
| -- add URLs to reading list | |
| my addToReadingList(theURLs) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | set theURLs to {} | |
| set Urls to paragraphs of (read POSIX file "/Users/username/Desktop/Urls.txt") | |
| repeat with nextLine in Urls | |
| if length of nextLine is greater than 0 then | |
| copy nextLine to the end of theURLs | |
| end if | |
| end repeat | |
| -- add URLs to reading list | |
| my addToReadingList(theURLs) | 
I hereby claim:
- I am lonbaker on github.
- I am lonbaker (https://keybase.io/lonbaker) on keybase.
- I have a public key whose fingerprint is 71F5 863D C755 E67B 2796 4A4C 86C2 5FB0 0411 7CBE
To claim this, I am signing this object:
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | /* | |
| smtpd.js is SMTP server written for node.js | |
| MIT License | |
| */ | |
| var tcp = require('tcp'); | |
| var sys = require('sys'); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | require 'socket' | |
| require 'syslog' | |
| require 'logger' | |
| require 'hoptoad_notifier' | |
| # TcpSyslog is used are a dead-simple replacement for | |
| # syslog ruby libs. None of them is able to send logs | |
| # to a remote server, and even less in TCP. | |
| # | |
| # Example: | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | ["http://internal/", "http://external/"].each do |server| | |
| uri = URI.parse(server) | |
| God.watch do |w| | |
| w.name = "httpmon_#{uri.host}" | |
| w.interval = 10.seconds | |
| w.start = "echo 'start'" | |
| w.stop = "echo 'stop'" | |
| w.lifecycle do |on| | |
| on.condition(:http_response_code) do |c| | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/usr/bin/env ruby | |
| ENV["RAILS_ENV"] ||= 'test' | |
| require File.expand_path(File.dirname(__FILE__) + "/../config/environment") unless defined?(RAILS_ROOT) | |
| start_time = Time.now | |
| puts "Starting CouchDB Benchmark..." | |
| 100000.times do |n| | |
| Person.new(:first_name => "Couch_#{n}", :last_name => "Man_#{n}").save | |
| end | |
| puts (Time.now - start_time) | 
NewerOlder