android build progress
This commit is contained in:
@@ -2,7 +2,7 @@ class ApplicationController < ActionController::Base
|
|||||||
layout :layout_by_resource
|
layout :layout_by_resource
|
||||||
|
|
||||||
|
|
||||||
protect_from_forgery
|
#protect_from_forgery
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class UserController < ApplicationController
|
class UserController < ApplicationController
|
||||||
before_filter :allow_mobile #, :authenticate_user!
|
before_filter :allow_mobile, :authenticate_user!
|
||||||
layout 'phone'
|
layout 'phone'
|
||||||
|
|
||||||
alias :list :active_list
|
alias :list :active_list
|
||||||
|
|||||||
+4
-1
@@ -3,12 +3,15 @@ class User
|
|||||||
include Devise::Orm::SimplyStored
|
include Devise::Orm::SimplyStored
|
||||||
property :active_list_id
|
property :active_list_id
|
||||||
|
|
||||||
devise :database_authenticatable, :recoverable, :rememberable, :trackable, :registerable
|
devise :database_authenticatable, :recoverable, :rememberable, :trackable, :registerable, :token_authenticatable
|
||||||
|
|
||||||
has_and_belongs_to_many :lists, storing_keys: false
|
has_and_belongs_to_many :lists, storing_keys: false
|
||||||
has_many :orders
|
has_many :orders
|
||||||
|
|
||||||
validates_uniqueness_of :email
|
validates_uniqueness_of :email
|
||||||
|
before_save :ensure_authentication_token
|
||||||
|
|
||||||
|
view :by_authentication_token, key: :authentication_token
|
||||||
|
|
||||||
def list_is_closed!
|
def list_is_closed!
|
||||||
self.active_list_id = nil
|
self.active_list_id = nil
|
||||||
|
|||||||
@@ -55,10 +55,10 @@ Devise.setup do |config|
|
|||||||
# It can be set to an array that will enable http authentication only for the
|
# It can be set to an array that will enable http authentication only for the
|
||||||
# given strategies, for example, `config.http_authenticatable = [:token]` will
|
# given strategies, for example, `config.http_authenticatable = [:token]` will
|
||||||
# enable it only for token authentication.
|
# enable it only for token authentication.
|
||||||
# config.http_authenticatable = false
|
config.http_authenticatable = [:token]
|
||||||
|
|
||||||
# If http headers should be returned for AJAX requests. True by default.
|
# If http headers should be returned for AJAX requests. True by default.
|
||||||
# config.http_authenticatable_on_xhr = true
|
config.http_authenticatable_on_xhr = true
|
||||||
|
|
||||||
# The realm used in Http Basic Authentication. "Application" by default.
|
# The realm used in Http Basic Authentication. "Application" by default.
|
||||||
# config.http_authentication_realm = "Application"
|
# config.http_authentication_realm = "Application"
|
||||||
@@ -176,7 +176,7 @@ Devise.setup do |config|
|
|||||||
|
|
||||||
# ==> Configuration for :token_authenticatable
|
# ==> Configuration for :token_authenticatable
|
||||||
# Defines name of the authentication token params key
|
# Defines name of the authentication token params key
|
||||||
# config.token_authentication_key = :auth_token
|
config.token_authentication_key = :auth_token
|
||||||
|
|
||||||
# ==> Scopes configuration
|
# ==> Scopes configuration
|
||||||
# Turn scoped views on. Before rendering "sessions/new", it will first check for
|
# Turn scoped views on. Before rendering "sessions/new", it will first check for
|
||||||
|
|||||||
+3
-2
@@ -38,9 +38,10 @@ Qrammer::Application.routes.draw do
|
|||||||
|
|
||||||
# USER
|
# USER
|
||||||
default_url_options format: 'html', host: 'bladiblah'
|
default_url_options format: 'html', host: 'bladiblah'
|
||||||
match '/user' => 'user#home', as: :user_root
|
match '/user' => redirect('/user/home.html')
|
||||||
|
match '/user/home' => 'user#home', as: :user_root
|
||||||
get '/user/active_list(.:format)' => 'user#active_list', as: :user_active_list
|
get '/user/active_list(.:format)' => 'user#active_list', as: :user_active_list
|
||||||
get '/user/list_info' => 'user#list_info', as: :user_list_info
|
match '/user/list_info' => 'user#list_info', as: :user_list_info, via: [:get, :options]
|
||||||
post '/user/needs_help' => 'user#needs_help', as: :user_needs_help
|
post '/user/needs_help' => 'user#needs_help', as: :user_needs_help
|
||||||
post '/user/list_needs_payment' => 'user#list_needs_payment', as: :user_list_needs_payment
|
post '/user/list_needs_payment' => 'user#list_needs_payment', as: :user_list_needs_payment
|
||||||
match '/user/create_list' => 'user#create_list', as: :user_create_list
|
match '/user/create_list' => 'user#create_list', as: :user_create_list
|
||||||
|
|||||||
Executable
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/bash
|
||||||
|
rm -rf public/assets;
|
||||||
|
RAILS_ENV=production rake assets:precompile;
|
||||||
|
RAILS_ENV=production rails runner script/build_mobile_app.rb
|
||||||
@@ -36,7 +36,7 @@ for action in uc.action_methods
|
|||||||
puts "action #{action} found"
|
puts "action #{action} found"
|
||||||
result = uc.render_to_string(action: action.dup)
|
result = uc.render_to_string(action: action.dup)
|
||||||
#result.sub! /<head>/, '<head><base href="file:///Users/bterkuile/Documents/workspace/Qwaiter/assets/" target="_self" />'
|
#result.sub! /<head>/, '<head><base href="file:///Users/bterkuile/Documents/workspace/Qwaiter/assets/" target="_self" />'
|
||||||
result.gsub! /(href|src)="([^#])/, %|\\1="#{root_url}\2|
|
result.gsub! /(href|src)="([^#])/, %|\\1="#{root_url}\\2|
|
||||||
File.open(File.join(android_root, 'user', "#{action}.html"), 'w'){|f| f.puts result}
|
File.open(File.join(android_root, 'user', "#{action}.html"), 'w'){|f| f.puts result}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user