rhodes

Ruby on Rhodes using ajax call

家住魔仙堡 提交于 2019-12-12 03:45:27
问题 I am trying to build a dynamic dropdown in ruby on rhodes.There are basically two dropdowns on my screen and i am using ajax to get the values of the second dropdown from the database depending on the value selected in the first dropdown..I am a newbie to ruby and do not know the syntax on how to use ajax in ruby on rhodes.. JavaScript Code I am using... $.post("/app/Settings/dropdown", { value:a }, function(data){ alert(data); }); -----Partial Controller Code enter code here def dropdown @a

Rhomobile how to edit the Android Manifest

混江龙づ霸主 提交于 2019-12-11 10:58:44
问题 I am having difficulty changing the AndroidManifest.xml file. "C:\RhoStudio\ruby\lib\ruby\gems\1.8\gems\rhodes-3.2.2\platform\android\Rhodes\AndroidManifest.xml" I am trying to add the following to the manifest for the build to allow me to save files to the SD card: <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> I add it but then when I build, the line does not appear in the AndroidManifest.xml that is outputted into the bin/tmp folder. 回答1: android: capabilities

Ruby Time zone returns full form in windows 7

与世无争的帅哥 提交于 2019-12-10 11:41:38
问题 I want to display the Timezone abbreviation. But my Ruby keeps giving me the fullform. irb(main):001:0> Time.now => 2014-02-28 15:11:21 +0530 irb(main):002:0> Time.now.zone => "India Standard Time" irb(main):003:0> This was in Ruby 1.9.3p125. Tried in Ruby 2.0 as well and same results! Even strftime("%Z") gives full form of the time zone and not the abbreviation. But the documentation clearly states that only the abbreviation should be returned. I am actually building a rhodes application on

Passing parameter in a Ruby function from HTML

霸气de小男生 提交于 2019-12-06 05:58:29
I have two files. .rb (with Ruby code) and .erb (HTML file with some ruby script). I am calling a Ruby function in .rb from .erb . .erb <a href="<%= url_for :action => :showProducts(i) %>">Click here</a> .rb def showProducts(param) //Some code end I am able to call a function without passing parameters to it. But as and when I pass parameters to function and then call it, I receive an error. I know this is the incorrect way to call a parametrized function from .erb . What is the correct way of calling a parameterized function from HTML? If you add in another key/value pair to the hash in url

How do cross-platform mobile app development frameworks work?

旧街凉风 提交于 2019-12-05 14:58:50
问题 How are Rhodes, Phonegap, and Appcelerator able to take Javascript or Ruby, and compile them into binaries for app SDKs that normally require apps to be written in Obj-C, Java, and others? 回答1: Phonegap uses the default browser rendering engine, and uses that to display your application. The javascript is then handled by the native (compiled) part of the framework. Appcelerator uses something simular, but compiles the whole application if i remember correctly. MoSync uses a somewhat simular

how to invoke a method for every second in ruby

会有一股神秘感。 提交于 2019-12-04 13:43:47
I wanted to create a stopwatch program in ruby so I googled it and found this SO Q . But over there, the author calls the tick function with 1000xxx.times . I wanted to know how I can do it using something like (every second).times or for each increment of second do call the tick function. Thread.new do while true do puts Time.now # or call tick function sleep 1 end end This function: def every_so_many_seconds(seconds) last_tick = Time.now loop do sleep 0.1 if Time.now - last_tick >= seconds last_tick += seconds yield end end end When used like this: every_so_many_seconds(1) do p Time.now end

How do cross-platform mobile app development frameworks work?

冷暖自知 提交于 2019-12-04 00:42:59
How are Rhodes, Phonegap, and Appcelerator able to take Javascript or Ruby, and compile them into binaries for app SDKs that normally require apps to be written in Obj-C, Java, and others? Erik Phonegap uses the default browser rendering engine, and uses that to display your application. The javascript is then handled by the native (compiled) part of the framework. Appcelerator uses something simular, but compiles the whole application if i remember correctly. MoSync uses a somewhat simular setup as javaME. Rhodes uses local server. It uses this to communicate with the device. jipiboily Jeff

How to get github token using username and password

吃可爱长大的小学妹 提交于 2019-12-03 07:29:46
问题 I am developing mobile apps using rhodes. I want to access private repo of github. I am having only username and password. How to get token of given username and password. 回答1: You should use oauth instead: http://developer.github.com/v3/oauth/ 回答2: Once you have only login and password you can use them using basic auth. First of all, check if this code shows you json data of desired repo. Username and password must be separated by a colon. curl -u "user:pwd" https://api.github.com/repos/user

How to get github token using username and password

蓝咒 提交于 2019-12-02 22:19:56
I am developing mobile apps using rhodes. I want to access private repo of github. I am having only username and password. How to get token of given username and password. Tekkub You should use oauth instead: http://developer.github.com/v3/oauth/ ibo.ezhe Once you have only login and password you can use them using basic auth. First of all, check if this code shows you json data of desired repo. Username and password must be separated by a colon. curl -u "user:pwd" https://api.github.com/repos/user/repo If succeeded you should consider doing this request from code. import urllib2 import json