ruby-on-rails-tutorials.blogspot.com
Ruby on Rails Tutorials: Rails3 UTF-8 support for strings
http://ruby-on-rails-tutorials.blogspot.com/2011/05/rails3-utf-8-support-for-strings.html
Ruby on Rails Tutorials. Easy Ruby on Rails Tutorials. Monday, May 9, 2011. Rails3 UTF-8 support for strings. There is a general problem in rails 3 with utf8 string support. For example upcase, downcase, titleize or capitalize. Basically these methods produce ASCII strings because of lots of memory usage of unicode strings. mb chars string method do the trick. Create a new rb file in /lib:. String].each do klass klass.class eval. Dirglob("./lib/*.{rb}").each { file require file }. Now you can call:.
ruby-on-rails-tutorials.blogspot.com
Ruby on Rails Tutorials: How to sort mysql table by ip address string column
http://ruby-on-rails-tutorials.blogspot.com/2011/08/how-to-sort-mysql-table-by-ip-address.html
Ruby on Rails Tutorials. Easy Ruby on Rails Tutorials. Wednesday, August 3, 2011. How to sort mysql table by ip address string column. There are lots of result for ordering mysql table by IP address string column on the net. These are almost hellish tricky. So I use this:. Ips=Ip.where(:reserved = false).order("INET ATON(address) ASC"). You can save numeric value of ip address also with. Then you can get the string value by ". Here is the link about mysql miscellaneous functions:. View my complete profile.
ruby-on-rails-tutorials.blogspot.com
Ruby on Rails Tutorials: How to set up production mode in Rails 4 with Thin and Apache
http://ruby-on-rails-tutorials.blogspot.com/2013/10/how-to-set-up-production-mode-in-rails.html
Ruby on Rails Tutorials. Easy Ruby on Rails Tutorials. Wednesday, October 16, 2013. How to set up production mode in Rails 4 with Thin and Apache. I just completed a few days of research on the problem: how can Apache serve static assets while Thin runs Rails 4 application on the given port. Apache should create far-future expires headers on assets also. So, to do this, you need some. My Apache virtualhost config:. ServerName my site.com. ServerAlias *.my site.com. DocumentRoot /home/my path/my app/public.
ruby-on-rails-tutorials.blogspot.com
Ruby on Rails Tutorials: I18n yml files in Rails3
http://ruby-on-rails-tutorials.blogspot.com/2010/11/i18n-in-rails3.html
Ruby on Rails Tutorials. Easy Ruby on Rails Tutorials. Monday, November 8, 2010. I18n yml files in Rails3. Labels are very simple also. Just take under helpers: and controller name: (helpers: and contact: in the example below). Submit definitions are the same like labels. En: contact: prices: show price: "%{price dollar}$" quote: "Coordinator: and quot;Crucifixion? And the reference in our view file (apps/views/contact/index.html.erb):. Contact, :url = {:action = 'new'}, :html = {} do f %. Is a good vari...
ruby-on-rails-tutorials.blogspot.com
Ruby on Rails Tutorials: Rails 3 ajax Autocomplete with jQuery and jQuery UI theme
http://ruby-on-rails-tutorials.blogspot.com/2012/02/rails-3-autocomplete-with-jquery-and.html
Ruby on Rails Tutorials. Easy Ruby on Rails Tutorials. Wednesday, February 29, 2012. Rails 3 ajax Autocomplete with jQuery and jQuery UI theme. So we want a form element with autocomplete. First thing to do is installing jquery-rails and jquery-ui-themes gems and require in Gemfile. Then require one of the jQuery UI theme into app/assets/stylesheets/application.css. Require self *= require tree . *= require style *= require jquery-ui/ui-lightness */. Take care of heredoc strings.). Then value key html=" ...
ruby-on-rails-tutorials.blogspot.com
Ruby on Rails Tutorials: How to create scriptaculous ajax inplace editor fields in Rails3 with validation
http://ruby-on-rails-tutorials.blogspot.com/2011/08/how-to-create-scriptaculous-ajax.html
Ruby on Rails Tutorials. Easy Ruby on Rails Tutorials. Tuesday, August 9, 2011. How to create scriptaculous ajax inplace editor fields in Rails3 with validation. First, we should do our html view in app/views/ips/index.html:. Div id="ips table div" %= render "ips table" % /div. Then, we create the table and the javascript code in our partial view (app/views/ips/ ips table.html.erb). Table cellpadding="10" tbody % unless @ips.nil? Then we should make the controller (app/controllers/ips controller.rb):.
ruby-on-rails-tutorials.blogspot.com
Ruby on Rails Tutorials: Scriptaculous Slider in Rails3 form
http://ruby-on-rails-tutorials.blogspot.com/2011/05/scriptaculous-slider-in-rails3-forms.html
Ruby on Rails Tutorials. Easy Ruby on Rails Tutorials. Wednesday, May 18, 2011. Scriptaculous Slider in Rails3 form. So there is an excellent slider. http:/ madrobby.github.com/scriptaculous/slider/. It is perfect to set up a select form element where values are predefined numbers or integers. First you have to download http:/ script.aculo.us/downloads. Javascript include tag "slider.js" %. Then we create a helper for it. (/app/helpers/application helper.rb). Posted by Semper Augustus. I get the errors:.
ruby-on-rails-tutorials.blogspot.com
Ruby on Rails Tutorials: How to get requested controller name, action name and id in Rails3 view
http://ruby-on-rails-tutorials.blogspot.com/2010/11/how-to-get-requested-controller-name.html
Ruby on Rails Tutorials. Easy Ruby on Rails Tutorials. Monday, November 22, 2010. How to get requested controller name, action name and id in Rails3 view. To get requested controller name, action name and id in view we will call a simple helper function. For example we have the '/users/show/23' request, by routing rule: 'match ':controller(/:action(/:id(.:format) )'. To get controller name:. Users' #to get action name, it is the method:. Show' #to get id information:. Posted by Semper Augustus.
ruby-on-rails-tutorials.blogspot.com
Ruby on Rails Tutorials: Each loop for a class or model instance variables
http://ruby-on-rails-tutorials.blogspot.com/2010/11/each-loop-for-class-or-model-instance.html
Ruby on Rails Tutorials. Easy Ruby on Rails Tutorials. Monday, November 22, 2010. Each loop for a class or model instance variables. Sometimes we need to check all of instance variables in a class or model one by one. In this exaple we will check if a varaible is an Array or not:. Your model.instance variables.each do i if your model.instance variable get(i).instance of? Array) then #your code to do anything with your model.instance variable get(i) what is a value end end. Posted by Semper Augustus.
SOCIAL ENGAGEMENT