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
| #config/initializers/carrierwave.rb | |
| CarrierWave.configure do |config| | |
| if Rails.env.production? or Rails.env.development? | |
| config.storage :cloud_files | |
| config.cloud_files_username = "your_username" | |
| config.cloud_files_api_key = "your_key" | |
| config.cloud_files_container = "test" | |
| config.cloud_files_cdn_host = "c0012345.cdnn.cloudfiles.rackspacecloud.com" | |
| def store_dir |
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 "prawn" | |
| Prawn::Document.generate("report.pdf") do | |
| 10.times do | |
| start_new_page | |
| end | |
| repeat :all do | |
| move_down 50 |
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
| def register | |
| # if request.post? | |
| if @user =User.find(:first,:conditions =>{:email =>params[:email],:imei =>params[:imei]}) | |
| render :xml => { :status => 0, :data => 'Email alredy taken!' }.to_xml | |
| else | |
| @user =User.new | |
| @user.email = params[:email] if params[:email] | |
| @user.password = params[:password] if params[:password] | |
| @user.name = params[:email].split('@')[0] | |
| @user.imei = params[:imei] if params[:imei] |
NewerOlder