similar to: need to transfer data from old php like db to rails style db

Displaying 20 results from an estimated 500 matches similar to: "need to transfer data from old php like db to rails style db"

2006 Jan 10
1
[AJAX] related drop-down list question
Hi all, I followed the example on: http://www.roryhansen.ca/?p=9 for creating related drop-down lists. However, this code actually creates HTML in the controller component: @albums = Album.find_all_by_artist_id(@params["artist_id"]) @html = "<select id=''album_id'' name=''album_id''>" @html += "<option
2009 Mar 11
1
NoMethodError for select_tag
Hello there. I am following a tutorial with rails 2.1 and I have come across a problem where <%= f.label :artist_id %><br /> <%= f.select_tag(:artist_id, options_for_select([[''choose one'', '''']] + @artists.collect {|art| [art.name, art.id]}, @album.artist_id)) %> (Old artist info:<%= @album.artist_old%>) gives undefined method
2006 May 04
4
form post not working
Hi there, I have this form code in a view: <%= start_form_tag :action => "listByArtist", :id => artist.id %> <p><b>List by Artist:</b> <select id="artist_id" name="artists[id]"> <%= options_from_collection_for_select(@artists, "id", "name") %> </select> <%= submit_tag "List"
2005 Dec 05
0
bug in bubbleshare's Active Record extensions?
I''m using add_foreign_key_constraint and remove_foreign_key_constraint from Bubbleshare''s Active Records Extension plugin now to manage the foreign key relationships I describe in my other recent posting. The constraints get added within migrations, but I''m running into two problems (Rails 0.14.3, PostgreSQL db): 1. Dumping the schema doesn''t dump the
2006 Feb 23
7
How to set a relationship with a value from a selection list
I realize this is probably a very basic problem but I''m developing my first rails app and running into this problem. I''m trying to write a photoblog application. I have a photo table and an album table. Photo has a to-one relationship to Album. Photo.album_id => Album.id In my view for photo I have a selection list that''s populated with all the available albums.
2011 Mar 19
5
Routing issue
Hi! I have two models, artists and songs. I have this in my route file: resources :artists, :path => "ackord" do resources :songs end Which gives me urls like this (I''m using https://github.com/norman/friendly_id to create and manage slugs): example.com/ackord/artistname/songs/songname-id Now I want to remove the /songs part to get a url like this:
2007 May 09
1
form.select wrong number of arguments (0 for 1)
I am new to rails, PHP background. I''m completely lost on this. I am trying to pull all of the albums from the albums table into a select box. But every time I run the script I get the "wrong number of arguments (0 for 1)" error. I''ve looked on other message boards and searched the web but I can''t seem to find the answer. I''ve tried several different
2006 Jun 11
4
remote_function posting?
Hi, I''ve noticed that my remote_function calls are resulting in POST requests. As a result, my routes do not apply since it does not generate a url based on the parameters, but simply posts to the raw url with post data. I want to make a GET request instead of a POST. How can I do that? Has anyone else run into this? Thanks, Ryan -- View this message in context:
2010 Oct 11
12
Need advice on controller / view
Need some advice. I''ve got two modules: artists and paintings. In my home page, I''ve got a 2nd page that says "Browse paintings", which displays ALL paintings of ALL artists. This is being rendered by paintings#index. In another page, I should show all paintings of a specific artist ONLY. Meaning, paintings from ONE artist. I cant use paintings#index for this anymore
2009 Apr 11
6
Inserting data from 1 table to another by using find_by_sql
Hi All, I am inserting data from one table to another by using following method @data=RoyaltyReportFiles.find_by_sql("insert into royalty_reports (artist_name, album_name) select artist_name, album_name from temp_royalty_reports where id=328417") it saves the data into royalty_reports table but it gives following error and application crashes. i am using rails 1.2.5 You have a nil
2005 Dec 10
0
Paginate - Count(*) Broken or Am I Cheating?
I have the following paginator setup: @merch_pages, @merch = paginate :merch_item, :per_page => 15, :select => ''DISTINCT mi.id, mi.merch_image, mi.created_at, mi.artist_id, mi.item_description, art.sort_name'', :join => ''as mi JOIN merch_formats mf ON mi.id = mf.merch_item_id JOIN artists art ON mi.artist_id = art.id'', :order =>
2010 Oct 01
20
Paperclip not executing FFMPEG properly
Im using a customs processor to run ffmpeg on a video to create a thumbnail. So far so good. Except when I do: cmd = "-i #{@file.path} -f flv -s 320x240 ~/Downloads/foobar/q.flv" success = Paperclip.run(''ffmpeg'', cmd) Console is reporting: ffmpeg ''-i /var/folders/uL/uL0bYOOZEZaJH5E+BmDJVE+++TI/-Tmp-/stream, 16824,1.mpeg -f flv -s 320x240
2006 Jul 17
6
3 newbie questions
hey all, I have 3 tables like this: Images (id,name) Tags (id,name) ImagesTags(imageid,tagid) in my image model I do a "has_and_belongs_to_many :tags" but to make it work I need to rename ImagesTags(imageid,tagid) to Images_Tags(image_id,tag_id). My question is that given that I can''t rename the table, is there any way to make it work with the original names? Second question:
2006 Apr 25
6
Searching over multiple MySQL tables
I am racking my brain over this, probably because I only know very simple mysql functions. Basically I''ve got a few tables, ex: Albums (id,name,band_id); Bands (id,name,label_id), and Label (id,name) I want to search through both album.name, band.name, and label.name throwing all results into a variable, with no redundant info. I think what I need to be doing is setting up some
2010 Aug 08
5
Ruby 1.8.7 and openssl failed compile
I got this error: ossl_ssl.c: In function ?ossl_sslctx_get_ciphers?: ossl_ssl.c:626:19: error: ?STACK? undeclared (first use in this function) ossl_ssl.c:626:19: note: each undeclared identifier is reported only once for each function it appears in ossl_ssl.c:626:25: error: expected expression before ?)? token ossl_ssl.c:629:47: error: expected expression before ?)? token
2010 Aug 08
1
help me
i am creating an aplication where table name albums width attributes CREATE TABLE albums ( id int(11) NOT NULL auto_increment, title varchar(255) NOT NULL default '''', artist_old varchar(255) NOT NULL default '''', release_date datetime NOT NULL default ''0000-00-00 00:00:00'', genre varchar(50) NOT NULL default '''', created_at
2007 Feb 26
24
Ruby/rails port of Cocoon/hibernate
Hi, I''m currently running an apache/jboss cocoon/flow/hibernate/ajax paypal (directpayment) project and am looking into the possibility of porting it across to ruby/rails. For that reason I would like to know the following: 1. Can I call my java classes or would I be looking at a complete rewrite in ruby? 2. How effective is ruby in terms of seperation of concerns regarding design from
2007 Aug 02
2
STI functionality, but then with multiple tables
Hello, I''m creating my own Tumblr [tumblr.com] like rails app. It''s like a blog, but in this case a blog post could be of a certain type, i.e. a regular post, a video, a link, a photo, a song(info). Well now, it''s clear that they share a lot of similar functionality: title, created_at/updated_at, commentable, probably has an author_id, etc.. But besides that they are
2009 Jul 15
2
Fixing ogg vorbis corruption caused by bad metadata
Adam Rosi-Kessel wrote: > Yes, it was Mediamonkey. They claim that it was due to a bug in vorbis > libraries. All software has bugs, but this explanation doesn't really add up. libvorbis is the codec. If they had blamed libogg, which does the container, then yes, that would have been a believable explanation :-). Erik --
2006 Oct 21
0
find_or_initialize_by and Nested Resources
Hey guys, Lets say I have the following nested resources: map.resource artists do |artists| map.resource songs end To create a new song, the url would be: /artists/:artist_id/songs/:song_id However, lets say that an artist doesn''t exist yet. I only want to create an artist if a new song by the artist is successfully saved. I am retrieving the artist using something like: @artist