48 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for rchawdhari

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 for Taywin
0
449
Member Avatar for Kevin_20

I have a MySQL table with a string-based primary key. I created it with an ActiveRecord::Migration as follows: create_table( "icd9s", id: false) do |t| t.string "ICD9Code", limit: 7, null: false t.string "ShortDescription", limit: 128, null: false t.string "LongDescription", limit: 255, null: false end add_index(:icd9s, :ICD9Code, unique: true) Then I went …

0
278
Member Avatar for Prince_9

How can I convert this Ruby Gem to PHP? token = "your_nypl_api_token" client = NyplRepo::Client.new(token) ``` ``` token = "your_nypl_api_token" options = {:debug => true, :server_url => "http://api.repo.nypl.org/api/v1"} client = client = NyplRepo::Client.new(token, options) Also url = "http://api.repo.nypl.org/api/v1/items/8568ccd0-c614-012f-1d74-58d385a7bc34.xml" uri = URI.parse(url) http = Net::HTTP.new(uri.host, uri.port) headers = { "Authorization" => …

Member Avatar for cereal
0
751
Member Avatar for Jack_9

Personally I think Python is better then ruby because it runs on the Django framwork and it can do more. But I wanted some debate from ruby devs so bring it on!!

Member Avatar for OrionBlastar
-2
526
Member Avatar for MasterHacker110

I'm trying to write a search enigne. Nothing fancy like google or so, just a simple one for educational purposes. I have done a little research and I know that Google uses Python, Java and C++. I on the other hand know C++, PHP, some Java and C# and even …

Member Avatar for kindo
0
241
Member Avatar for kyleo92

I'm attemping to clone and install a Ruby application from github. I have it cloned, and am trying to run the "bundle install" command, but it failed the first time because of an issue with Rake. I installed it manually using "gem install rake -v '10.1.1'". That command was sucessful, …

Member Avatar for BrentK
0
263
Member Avatar for Nautical.RB

Hello daniweb community i'm new here and glad to join this amazing website. Well want I need to understand is how I learn to become a competent computer science major and learn to write code very well. I have always had a knack for this and I love it alot …

Member Avatar for phorce
0
373
Member Avatar for arupface

There is `text label` on a webpage, and I am trying to click on that to open a pop-up window,but not getting opened. here is the `HTML` code: <td width="40%"> <div id="EmpId.outline"> <input type="hidden" name="EmpId" value="" id="popupEmpId"> <input type="text" name="EmpCode" value="" readonly="readonly" class="textMedium250" id="popupEmpCode" autocomplete="off"> <a href="#f2"><label onclick="checkForPopup('EmpPopupDiv','Select a Emp',640,true,refreshConditionOptions);"> + Search for a Emp</label> </a> …

Member Avatar for Taywin
0
174
Member Avatar for Ritesh_4

Hello, anyone can help me with parsing an html table data to be saved directly in an excel file from the same parsing app?

Member Avatar for Taywin
0
218
Member Avatar for stevanity

Hey guys. Im designing a web app with rails for storing and analysing college students' marks. Ive come up with a database design like this: ![First](/attachments/large/3/First.png "First") Now IM not sure how to set the associations. Can you please help me? And is the design ok?

Member Avatar for stevanity
0
109
Member Avatar for Ritesh_4

Hello, anyone can help me with how to build a simple user registration form using Rails from scratch, with the fields Login Name, Name, Address and Password (encrypted)? I will be using MySQL to host the database. I've already created the new project using: rails new reg_form, now what next??

Member Avatar for lambing
0
116
Member Avatar for PrometheanSin

after pulling my hair out with this one, I'm afraid I'm going to have to turn the knowledge of those much wiser.....again! ok so here's the problem, I am following the following two railscasts: [deploying to a vps](http://railscasts.com/episodes/335-deploying-to-a-vps?autoplay=true) [asset pipeline in production](http://railscasts.com/episodes/341-asset-pipeline-in-production?autoplay=true) My setup: Ubuntu Server 12.04 nginx unicorn ruby …

Member Avatar for PrometheanSin
0
723
Member Avatar for Ritesh_4

Hello, anyone can help me with the conversion of single quotes in a string to double quotes? Am new to Ruby programming and still learning around on how to use it properly. I have an example in Delphi, which I want to make compatible with Ruby: function ReplaceSingleQuote(AText: String): String; …

Member Avatar for Ritesh_4
0
135
Member Avatar for Dante2

ok, so here's the deal. Going over the Rails tutorial. We're running a testing environment to make sure that the things we want showing up on our pages are making it. Doing this using pages_controller_spec.rb file. And this is one of three arguments that we passed: [ICODE]describe "GET 'home'" do …

Member Avatar for Dante2
0
131
Member Avatar for a-lago

Hi im starting to learn programming and I'm stuck in this [CODE] puts "enter as much words as you like and i will sort them" words = [] while true words.push gets.chomp if words.last == "" words.delete(words.last) break end end sorted = [] def sort unsorted, sorted, num, var while …

Member Avatar for a-lago
0
739
Member Avatar for fk123

[CODE] a=gets.to_i b=gets.to_i [/CODE] this code gets input like this 2 2 but in c++ std::cin will get input after space or \n So how do I make ruby get input like std::cin I am new to ruby and can not find the answer on google so help would be …

Member Avatar for fk123
0
148
Member Avatar for Dante2

Ok, I'm using the Head First Rails book, which sadly, was written in 2009. So, the API has changed drastically. I am trying to manually configure a route to make the controller find my show page. The route the book tells me to type [ICODE] map.connect '/ads/:id', :controller=>'ads', :action=>'show' [/ICODE] …

0
87
Member Avatar for monica23

Hi everybody, in my database, am trying to print the value of total and then add it to the price, i was able to fetch the value of total but when i tried to add it to to price so as to get value of sum in this line of …

Member Avatar for monica23
0
109
Member Avatar for Amr87

Hello Everyone, I`m a PHP developer, These days I`m thinking seriously about learning ruby , but I`m not sure if it gonna add to my knowledge , so i have few questions about it and hope that a ruby specialist will answer me 1- Do I need to learn ruby …

Member Avatar for Amr87
0
367
Member Avatar for Trilby1992

Hi I'm trying to make a friend request feature like in a social networking site and I've been getting this Unknown Attribute error whenever I try to request a friendship with an another user. [url]http://s1042.photobucket.com/albums/b429/Kevin_Tang/?action=view&current=unknown_atrribute.png[/url] And this is the code of the friendship controller. [CODE]class FriendshipController < ApplicationController def req …

Member Avatar for Trilby1992
0
186
Member Avatar for G_S

Hello everybody I have a question: is it possible to compile ruby files into bytecode. Does ruby have something like .pyc files? I found some discussions online about generating .exe's from ruby files, but what I want to know if it is possible to compile .rb files just like you …

Member Avatar for G_S
0
156
Member Avatar for wilch

Hi All I am looking for a new language to learn and add to my language set that already contains PHP & C# in much depth. Ruby is one language i was thinking of learning. Can you guys please give me practical uses and/or applications that use/may use Ruby. I …

Member Avatar for snippsat
0
241
Member Avatar for jember

What is the best IDE that I should use to make a program using Ruby Language? And where can I download it for free? I'm self studying. :)

Member Avatar for kvprajapati
1
185
Member Avatar for benjaminFowl87

Hi I have my initialise constructor, why won't my function to_hash work ? [CODE]def initialize(msg) @original_msg = msg.strip.delete(' ') s = ["|","^"] @chunked_msg = @original_msg.split(s[0]) @msg_hash.self.to_hash end def to_hash @chunked_msg.each do |x| s = x.split("=") @msg_hash[s[0]] = s[1] end return @msg_hash end[/CODE]

Member Avatar for benjaminFowl87
0
96
Member Avatar for Clawsy

Hello, I use Ruby with Sinatra in my application and I need to store a big data (exceeding 4K) in my session or somewhere secude on the server because I do some API calls and I refer to that data very often and that's why I need it stored. The …

Member Avatar for Clawsy
0
402
Member Avatar for johndoe444

problem with this code: [CODE]parseIcmPage url, '<ul id="topListFilter"', '<div id="footer">' def parseIcmPage(url, start_point, end_point) data = getHtmlPage url s = data.index(start_point) e = data.index(end_point, s) len = e-s list_str = data.index[s, len] puts list_str, '\n' end[/CODE] [CODE]icm.rb:42: warning: don't put space before argument parentheses ./util.rb:121:in `index': wrong number of arguments …

Member Avatar for craiggles
0
229
Member Avatar for Excizted

Hi. I'm just trying out Ruby on Rails, and I'm trying to create some application that takes a hostname from the user and then checks if it is connectible through Net::SSH and if it is, it should check if a file is present. Quite simple, and I also almost reached …

Member Avatar for Excizted
0
182
Member Avatar for colwem

I'm definitely a noob to rails so sorry if this is trivial. I have tables with associations on them. The associations are supposed to add methods to my models like model.others and model.others= and so on but when I try to use them I get errors like the following. NoMethodError: …

Member Avatar for colwem
0
162
Member Avatar for dayt3

I'm working on comp. science 101 work and I have 4 methods left to do which I can't figure out and I've been trying for hours. Very elementary but difficult for smoeone new to computers and Ruby. For example: I need to write a method called 'diff' which accepts 2 …

Member Avatar for dayt3
0
119
Member Avatar for Kruptein

I do php coding for some time and want to learn something new. After some researsh I ended up with 2 languages/frameworks but I can't choose between them. I'm a python programmer so python Django might be easier to start with. But I don't know a well-known website which is …

Member Avatar for Kruptein
0
511

The End.