A proof of concept of having Sinatra like routes inside your controllers.
Since the router is gone, feel free to remove config/routes.rb.
Then add the file below to lib/action_controller/inline_routes.rb
inside your app.
| #!/bin/bash | |
| # Add to your .bashrc on Mac OSX, then run camfix in Terminal | |
| # if the Mac's built-in camera stops working. | |
| # Thanks to: http://osxdaily.com/2013/12/27/fix-there-is-no-connected-camera-error-mac/ | |
| alias camfix='sudo killall VDCAssistant; sudo killall AppleCameraAssistant' |
| #!/usr/bin/env ruby | |
| # Author : Emad Elsaid (https://github.com/blazeeboy) | |
| require 'json' | |
| require 'open-uri' | |
| require 'uri' | |
| require 'net/http' | |
| CODE_LIMIT = 10 | |
| $url = "https://eval.in/" | |
| $languages = { |
| ======= Prolbem ================================================================================================================= | |
| I have installed : ruby-2.0.0,postgres-9.2 , now in rails app when I execute: | |
| rake db:create , command I get: | |
| PG::InvalidParameterValue: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII) | |
| HINT: Use the same encoding as in the template database, or use template0 as template. | |
| : CREATE DATABASE "my_db_name" ENCODING = 'unicode'....... | |
| bin/rake:16:in `load' |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>comment</key> | |
| <string> | |
| TODO: unresolved issues | |
| text: |
| ## Prepare ################################################################### | |
| # Remove RVM | |
| rvm implode | |
| # Ensure your homebrew is working properly and up to date | |
| brew doctor | |
| brew update | |
| ## Install ################################################################### |