- Generate new rails app using
--webpackflag
rails new myApp --webpack=vueNote:
- You can use
--webpack=angularfor angular application and--webpack=reactfor react.
| #!/usr/bin/env ruby | |
| # gem install active_support | |
| require 'active_support/inflector' | |
| require 'active_support/core_ext/string' | |
| # gem install webrick (only ruby3) | |
| require 'webrick' | |
| # gem install mechanize |
| // on error the server sends JSON | |
| /* | |
| { "error": { "data": { "message":"A thing went wrong" } } } | |
| */ | |
| // create model classes.. | |
| public class ErrorResponse { | |
| Error error; | |
| import org.json.JSONArray; | |
| import org.json.JSONException; | |
| import org.json.JSONObject; | |
| import java.util.*; | |
| public class JsonHelper { | |
| public static Object toJSON(Object object) throws JSONException { | |
| if (object instanceof Map) { | |
| JSONObject json = new JSONObject(); |