README.md in native-2.0.1 vs README.md in native-2.1.0

- old
+ new

@@ -76,39 +76,14 @@ To wrap things up, migrate the changes into your database: $ rails db:migrate -Go to `app/assets/config/manifest.js` and add the following lines: - -```js -//= link_directory ../native/android/javascripts .js -//= link_directory ../native/android/stylesheets .css -//= link_directory ../native/ios/javascripts .js -//= link_directory ../native/ios/stylesheets .css -//= link_directory ../native/uwp/javascripts .js -//= link_directory ../native/uwp/stylesheets .css -//= link_directory ../native/chrome/javascripts .js -//= link_directory ../native/chrome/stylesheets .css -//= link_directory ../native/osx/javascripts .js -//= link_directory ../native/osx/stylesheets .css -//= link_directory ../native/win32/javascripts .js -//= link_directory ../native/win32/stylesheets .css -//= link_directory ../native/win64/javascripts .js -//= link_directory ../native/win64/stylesheets .css -//= link_directory ../native/lin32/javascripts .js -//= link_directory ../native/lin32/stylesheets .css -//= link_directory ../native/lin64/javascripts .js -//= link_directory ../native/lin64/stylesheets .css -//= link_directory ../native/web/javascripts .js -//= link_directory ../native/web/stylesheets .css -``` - Let's move on to your devise class. For instance `User` located in `app/models/user.rb`. Associate belonging `App` objects: ```ruby -has_many :apps, class_name: 'Native::App' +uses_native_apps ``` Lastly, got to your routes file (`config/routes.rb`) and mount the `Native::Engine` class: ```ruby @@ -131,23 +106,23 @@ **Note:** Native also supports the coexistence of multiple NativeGap apps with only one Rails app as a source. ### Assets -With Native it is fairly simple to add platform specific stylesheets and scripts. In your assets directory you have a separate folder (`app/assets/native`) for every platform behaving similarly to the root assets folder. You are not only able to add custom assets for those platforms added by Native, but you can also add `web` specific assets. +With Native it is fairly simple to add platform specific stylesheets and scripts. In your assets directory you have a new folder for your `javascripts` and `stylesheets` (`app/assets/.../native`). In these two folders you are able to add custom assets for specific platforms including `web` specific assets. You simple have to include ... ```ruby = native_assets ``` -... in the `head` tag of your layout. +... in the `head` tag of your layout after your other asset include tags. ### App methods -Native introduces an `App` activerecord model. Every object of your devise class can have multiple apps. +Native introduces an `App` ActiveRecord model. Every object of your devise class can have multiple apps. ```ruby a = App.first # Returns associated object. Can return `nil`. @@ -201,11 +176,11 @@ If you want to use them in your controllers, just add `include NativeHelper` at the top. ### Notifications -You can enable native notifications on most platforms. To handle notifications Native integrates with thew [notifications-rails](https://github.com/jonhue/notifications-rails) gem. +You can enable native notifications on most platforms. To handle notifications Native integrates with the [notifications-rails](https://github.com/jonhue/notifications-rails) gem. Implement theĀ [notification-pusher-onesignal](https://github.com/jonhue/notifications-rails/tree/master/notification-pusher/notification-pusher-onesignal) component to push notifications to your native applications. ### Content scaling (Android) NativeGap apps on Android often look scaled down. To fix this in your app add the following to `app/assets/native/android/javascripts/application.js`: @@ -221,10 +196,10 @@ --- ## Configuration -You can configure Native by passing a block to `configure`: +You can configure Native by passing a block to `configure`. This can be done in `config/initializers/native.rb`: ```ruby Native.configure do |config| config.android = true end