Hi all, This is my array of hash [{"gate_pass_type_id"=>2, "tag"=>0, "total"=>2000}, {"gate_pass_type_id"=>125, "tag"=>0, "total"=>300}, {"gate_pass_type_id"=>661, "tag"=>0, "total"=>750}, {"gate_pass_type_id"=>661, "tag"=>2, "total"=>100}] I want to convert it into [2 => { "0"=> 2000}, 125=> {"0"=>300}, 661=>{"0" =>750, "2"=>100}] Is any simple way without using so much loops

Member Avatar
Member Avatar
+0 forum 2

[B] Can any one just give a video tutorial link to deploy ...a complete ror app..or any text tuts for tat.... [COLOR="Red"]Thanks in advance[/COLOR] .[/B]

Member Avatar
Member Avatar
+0 forum 4

Hi, I have two tables as employee id int primary key, purchase_order_product int, bundle int fabric_bundles id int primary key, purchase_order_product int, bundle int, quantity I want to make assciation between employee and fabric_bundles via purchase_order_product and bundle

Member Avatar
Member Avatar
+0 forum 3

Hi there, I'm a long time PHP programmer, 6 month newb python developer, but entirely new to git and gitlab. I've spent 2 solid work days trying to solve this issue, I've chatted with others in chat rooms, all to no avail. I'm not certain where I should post this question, but I figure it's a software issue so I'll initially place it under Software Development. I installed XenServer (A hypervisor for virtual machines), then Ubuntu Server 14.04 LTS on that, and then the most up-to-date Omnibus Gitlab package. I've assigned the machine 4 CPU's, 4GB ram, and 50GB inital …

Member Avatar
Member Avatar
+0 forum 2

Hi all, My project is on ruby on rails. I have one of ruby api returns json.jbuilder But I want that my api should not return json , it will display html.erb file Is anybody can help me???

Member Avatar
+0 forum 0

Hi , I want to create a class in lib folder , from that class want to create mysql view . such as in mysql CREATE VIEW rocket_current_activities AS SELECT rocket_activities.status AS status from rocket_activities.... This can be do in mysql but how to do from rails. I dont want in migration file. Please help!!!

Member Avatar
Member Avatar
+0 forum 3

I have created an app with simple login authentication, it is actually a twitter clone. The user logs in and access the pages, etc. But when the user posts something from there profile. It gives an error NoMethodError in RibbitsController#create undefined method `userid=' The error is around line 5: class RibbitsController < ApplicationController def create @ribbit = Ribbit.create(user_ribbits) @ribbit.userid = current_user.id if @ribbit.save redirect_to current_user else flash[:error] = "Problem!" redirect_to current_user end end private def user_ribbits params.require(:ribbit).permit(:content, :userid) end end The request given to the app: Parameters: {"utf8"=>"✓", "authenticity_token"=>"dwVmjDNO4GOowphGFgChMDBxBfvka+M/xSUHvJMECzwxtv4NF6OuWtiaX74NLz91OwQJ9T9+wm7yMiPQ0BLpGA==", "ribbit"=>{"content"=>"hi. test.\r\n"}, "commit"=>"Ribbit!"} The **sessions** controller: class SessionsController < ApplicationController def …

Member Avatar
Member Avatar
+0 forum 3

I'm trying to implement upload on [my application](http://github.com/bl4ckdu5t/vitabiotics). I'm hosting the application on Heroku, and I'm using S3. I've created a bucket and I've followed [this guide](https://devcenter.heroku.com/articles/paperclip-s3) trying to make it all work. But it still fails and I get no errors. The uploaded images never get to the bucket.

Member Avatar
+0 forum 0

I am a newbie programming Ruby. I have the below code. Method sum_to_n? which takes an array of integers and an additional integer, n, as arguments and returns true if any two elements in the array of integers sum to n. It should return true for the empty array with zero argument, but keeps returning false. def sum_to_n? (arr, n) hash = Hash.new(0) arr.each do |val| if hash.key? val return true else hash[n-val] = val end end return false end What am I doing wrong ?

Member Avatar
Member Avatar
+0 forum 9

Hi i m just learning rails and i want to import my sql data to rails .. i have created database and i had run rake to create shema etc... i m using windows 7 thx

Member Avatar
Member Avatar
+0 forum 2

Somewhat new to rails and trying to build something to learn, but having an issue. I have successfully created one form field that reads from a collection of categories. I generated scaffolding for the categories and two fields catId and name. After plugging in the field everything worked perfectly. I have tried to replicate this with a different name now (zipCode), but am getting an error saying an undefined method of zipCode when trying to save the event (the form that is being filled out). I'm not understanding why this isn't working as easily as the categories did. I have …

Member Avatar
Member Avatar
+0 forum 1

I need to sort tables with dynamical content with rails. I could use the RailsCast tutorial ([http://railscasts.com/episodes/228-sortable-table-columns](http://railscasts.com/episodes/228-sortable-table-columns)) but as I'm not using any specific method in a controller, it doesn't seem appropriate solution. I found out about the jquery tablesorter, but it doesn't seem to work. Where the solution might be? <table id="myTable" class="span7"> <tr> <th>Name</th> <th>Content</th> <th>Deadline</th> <th>Assignee</th> <th></th> <th></th> </tr> <%= render @project.tasks %> </table> application.js $(document).ready(function(){ $("#myTable").tablesorter(); }); Where the solution might be?

Member Avatar
Member Avatar
+0 forum 1

What are the various Components of Rails?

Member Avatar
Member Avatar
+0 forum 2

I hear that RUby can be used for desktop development, yet I haven't seen any showcases. I am currently learning C++ but have always had my eyes on Ruby. Is it true? I know Ruby On Rails is for web development. What are the capabilities of ROR? Thanks in advance.

Member Avatar
Member Avatar
+0 forum 3

Hi just start learning rails i found some difficulties to start the server under linux mint please find the errors i get /var/lib/gems/1.8/gems/railties-3.2.13/lib/rails/script_rails_loader.rb:11: warning: Insecure world writable dir /sbin in PATH, mode 040777 /var/lib/gems/1.8/gems/bundler-1.3.5/lib/bundler/runtime.rb:216: warning: Insecure world writable dir /sbin in PATH, mode 040777 /var/lib/gems/1.8/gems/execjs-1.4.0/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable) from /var/lib/gems/1.8/gems/execjs-1.4.0/lib/execjs.rb:5 from /var/lib/gems/1.8/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require' from /var/lib/gems/1.8/gems/coffee-script-2.2.0/lib/coffee_script.rb:1 from /var/lib/gems/1.8/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require' from /var/lib/gems/1.8/gems/coffee-script-2.2.0/lib/coffee-script.rb:1 from /var/lib/gems/1.8/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `require' from /var/lib/gems/1.8/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1 from /var/lib/gems/1.8/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require' from /var/lib/gems/1.8/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require' from /var/lib/gems/1.8/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each' from /var/lib/gems/1.8/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `require' from /var/lib/gems/1.8/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each' from /var/lib/gems/1.8/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require' from /var/lib/gems/1.8/gems/bundler-1.3.5/lib/bundler.rb:132:in `require' from …

Member Avatar
Member Avatar
+0 forum 3

Hi, I'm developing an application which needs to check user-inputted credentials against a Mysql database running on a web server. Does anybody know how I could communicate between c++ and a PHP or Ruby on Rails page and then parse the results back to the client? Many Thanks

Member Avatar
Member Avatar
+0 forum 1

Hi, I have module that imports data from json file to hash. Json file is pretty big so I don't want loading to take place on every request because it takes some time. It would be best to do this just on server start. I have a class variable in module called "data" which I'd like to set only on server start and then I can access to it on every request with SomeModule.data (I use mattr_accessor). I tried to import data in application config.after_initlize method but id doesnt work - data persists only on first request and on second …

Member Avatar
Member Avatar
+0 forum 2

I'm converting a Java/J2EE app over to Ruby/Rails. I need a solution for the CORBA calls. I see that Ruby has its own distributed API (DRb) and there are a few 3rd party CORBA tools, but nothing seems viable for actually doing CORBA in Ruby. What are you guys using professionally? Disclaimer: I've already searched Google and tried a number of tools. So please only suggest somethig if you are personally using the tools or 100% sure they work. :)

Member Avatar
Member Avatar
+0 forum 1

I have been developing a rails app for a week now. I use jquery-rails gem to use jQuery and everything was working fine. But today, when I started the development server, jQuery just wasn't loading. The console gave the error `jQuery not defined` and `$ not defined` and so forth. So I checked if the jQuery files are being included and they were. But when I clicked on the link to the `jquery.js` file, it contained only the following. (function() { }).call(this); jQuery just isnt working.. This is how I have required the js libraries: //= require jquery //= require …

Member Avatar
Member Avatar
+0 forum 1

Is anyone running Ruby on Rails on an Imac G4 or G5? Im on a tight budget right now and dont wanna spend more than I have to. Are either of these models working for anyone? If youre not using them, could I still use either one of these models?

Member Avatar
Member Avatar
+0 forum 6

Ok, so I'm working from a book called Agile Web Developement with Rails 4th Edition. I got up to page 83 where they have us running tests to ensure proper validation of our code up to this point. So I have checked and rechecked to make sure my code is identical to theirs. I keep getting an error. This is the test: test "product attributes must not be empty" do product = Product.new assert product.invalid? assert product.errors[:title].any? assert product.errors[:description].any? assert product.errors[:price].any? assert product.errors[:image_url].any? end This is the error I get: ==================================== /home/mint/Documents/depot/test/unit/product_test.rb:1:in `test': wrong number of arguments (1 for 2) …

Member Avatar
Member Avatar
+0 forum 6

Alright. I am a beginner and I am unable to find a solution to this problem. I am developing this quizzing application. I have built the part that allows you to create and manage questions classified by difficulty and tags. But Im not able to think of a proper quiz logic. I want a single page with question numbers and one question displayed at a time. And I want to be able to move back and forth by clicking the numbers and I should have some way of indicating the attempted questions. Then I need an option for a timer …

Member Avatar
Member Avatar
+0 forum 3

Hello, I am having trouble finding a good tutorial on how to install eclipse with aptana radrails on centos, when i try to install radrails in eclipse using the instructions givin here ([aptana](http://www.aptana.com/downloads/start)), i get these errors. Can someone point me in the right direction? Thanks :) An error occurred while collecting items to be installed session context was:(profile=PlatformProfile, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=). No repository found containing: osgi.bundle,org.eclipse.ant.core.source,3.2.200.v20100427 No repository found containing: osgi.bundle,org.eclipse.ant.launching,1.0.0.v20100427 No repository found containing: osgi.bundle,org.eclipse.ant.launching.source,1.0.0.v20100427 No repository found containing: osgi.bundle,org.eclipse.ant.ui,3.5.0.v20100427 No repository found containing: osgi.bundle,org.eclipse.ant.ui.source,3.5.0.v20100427 No repository found containing: osgi.bundle,org.eclipse.compare.core.source,3.5.100.I20100526-0800 No repository found containing: osgi.bundle,org.eclipse.compare.source,3.5.100.I20100526-0800 No repository found …

Member Avatar
Member Avatar
+0 forum 1

Hi, I'm working on rails project where I use json file for storing some data. Basically data are stored and get using ajax calls from jquery. But there are some strange issues. For example, when I add data in json file using AJAX and then open file in Chrome: localhost:3000/example.json there are no data. I open the file in firefox and data exists. When i refresh file in Chrome there are data. Sometimes data is inserted correctly. Maybe it could be browser cache issue? I know that AJAX is asynchronous but sometimes there are few refreshes needed for data to …

Member Avatar
+0 forum 0

Hi, I've been working with Ruby on Rails to make a web application, but I've found something that I really cannot work out how to do with it, so it may be best if I do it manually. Basically, I've got a dropdown menu, that is populated with a list of projects. I want users to be able to select a project from that list, and then all the details appear below it in a table (2 rows, the headers and the info). How would I acheive this with AJAX? Any help anyone could give would be great, thanks!

Member Avatar
+0 forum 0

Hi everyone, I'm a bit new to Ruby *and* Rails, and I'm struggling with a task I'm trying to accomplish. I'm attempting to build a simple Rock-Paper-Scissors game in Ruby on Rails, and I'm a little lost as to where to begin. It seems to me that the app will need Users, a Computer-user to play against, and a Game engine that actually performs the matchup between the user and the computer and returns the result. However, I don't seem to have a good enough understanding of the MVC architecture or of how RoR works to know where to start. …

Member Avatar
+0 forum 0

I try to develop a rails web search engine that aims to use carrot 2 clustering rest service that is also work on my computer. However to use these two I need to deploy both of them to same server. Do you know any hosting that makes available to run both at the same time or do you mind and plus solution. I am really stack on this issue. On local host they can work on different Ports however ha it possible to run them also on any Web hosting and communicate them with carrot two rest service... Please help..

Member Avatar
+0 forum 0

I'm looking at learning Ruby (including Ruby On Rails) or Python (Including any of its frameworks - though which is better?). What are the pros/cons of each? Thanks in advance.

Member Avatar
Member Avatar
+0 forum 7

Hey everyone! I was recently introduced to Ruby and am trying to learn it by working my way through the Ruby on Rails 3 Tutorial, but I got a little stuck on autotesting. The guide says that for Windows I should install "Growl for Windows," which I did, and then to use [ICODE]gem install autotest-growl -v 0.2.4[/ICODE], and I did that and nothing appeared for around five minutes (unusually long time) and then it returned: [ICODE]Error: while executing gem ... (errno::einval) Invalid argument - C:/Ruby192/lib/ruby/1.9.1/time.rb[/ICODE] I have never had this sort of error before and none of the commands I …

Member Avatar
+0 forum 0

how to populate select box depending upon the selection of the radio button on rails anyone knows what will be the possible ajax and rails script for populating dropdown list values based on selected radio button on rails 3 example there are two type of platform choices(windows, unix) of radio button then when you clicked the unix radio button, the dropdown listbox will filter only the unix type something(patch). The idea is the dropdown has a contents already from the database (<%= f.select :other_platform, Patch.all.map {|p| ["#{p.patch_type} #{p.number}: #{p.summary}", p.id ] }, {:include_blank => true} %>) then I need to …

Member Avatar
Member Avatar
+0 forum 5

The End.