similar to: sharing among views

Displaying 20 results from an estimated 10000 matches similar to: "sharing among views"

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 Aug 11
5
Why does no one like render_component?
Maybe I''m missing the point? Lets take for example albums of pictures. If I have a scaffold for each, and I''m showing an album, what if I want to list all of the pictures that are in the album? Surely, I''d want to call the List action in the picture controller. render_component would do this perfectly. But we''re told not to use render_component. So
2005 Dec 22
2
Documentation for generate controller
I can find the API documentation, but where is the documentation for the standard generators. The wiki has 3rd party generators- but I want to know specifically what generate controller does, and how it differs from generate scaffold, and what other generators there are. Where is this succinctly documented? -- Posted via http://www.ruby-forum.com/.
2006 Mar 28
1
Simple Sidebar Solutions: How does yours work?
I''m working on a simple photo gallery app for personal use and I want to generalize the sidebar such that in any page (controller or view, I''m not sure which) I can dynamically add either 1. links to a given sidebar 2. or an entire sidebar. I know that typo does this, and I''ve looked the code. I think it''s too complex a solution for my simple site.
2006 Mar 13
6
lame newbie question: how to pass instance variables
This should be obvious - but I''m a long-time non-web app programmer and new to rails. I simply want to put something in a variable in one action and access it in another. It''s like this, I''m doing a simple photo gallery/managment app, and I have two actions in my picture_controller: The first one scans the picture directory and creates a new object in the pictures
2003 Jan 29
1
album cover art in .ogg?
I've added ogg support to my player app. Now I'd like to be able to write/read album cover art (jpg, png, what ever) out of the ogg file and display it, as I do with mp3s. This assumes that an album cover art picture can reside inside of an ogg file. I've read through the vorbis.com/faq.psp as well as the list archives and haven't found any direct answers. The section on comments
2007 Apr 22
4
embedded pictures in vorbis comments?
Hello, I'd like to ask about the possibility of embedding pictures like an album cover artwork into a vorbis comment header. Since the data in a comment string after the separating "=" has a defined length, this could theoretically also be binary picture data. For example "PICTURE=[...any binary data...]" It only would be a problem for existing software which isn't
2007 May 12
4
help, 1 error(s) on assignment of multiparameter attributes
Hi everyone! I just started learning Ruby on Rails about a week ago for a school project, and can''t seem to find a solution for something. I have this inside the form inside of edit_albums.rhtml: <%= start_form_tag :action=>''proccess_edit_album'', :id=>@album.id %> .... Release Date: <%= datetime_select(:album, :release_date, :start_year => 1960)
2006 Jan 03
1
Passing parameters with link_to
I have following code in my controller: class AlbumsController < ApplicationController def list_by_year(year) @album_pages @albums = paginate :albums, { :per_page => 10, :conditions => ["year = ?", year] } render :action => ''list'' end end Now I want to make a link to the list_by_year action in
2007 Jul 04
2
including images
2007/7/3, Ralph Giles <giles@xiph.org>: > > On Tue, Jul 03, 2007 at 07:18:17PM +0200, Harry Sack wrote: > > > Can anybody tell me what the maximum filesize is for an image file to be > > included in a FLAC file? I'm just exploring this feature and I didn't > find > > this yet > > The metadata block length field is 24 bits, so the upper limit is
2008 Oct 13
10
Album art - requirements
Hi, there was a thread a few months ago about album art, and how to embed it in an Ogg stream. The outcome was unconclusive, and kind of settled on the existing practice of adding a uuencoded image in a Vorbis comment, or similar. A better solution would be to embed those images as a separate stream, including hints as to what image represents (front cover, back cover, etc). The obvious
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
2008 Jan 10
4
Mocking and stubbing Rails'' association extensions
I''m having a lot of trouble stubbing out an association extension for some view tests. Example rails code modeling a music album: class Album < ActiveRecord::Base has_many :songs do def streamable find(:all, :conditions => ''streamable = 1'') end end end So for a given Album instance (say @album), I need to be able to stub both
2007 Apr 28
1
AW: embedded pictures in vorbis comments?
Hi, I think we can start by defining an official field name at www.xiph.org/vorbis/doc/v-comment.html which is used as a file system link to an existing image file. I suggest the field name to be "PICTURE". What is ogg MNG? Is it a container format for PNG files which should be embedded in OGG files? If I understand correctly, the picture would be placed in a different logical stream
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
2006 May 31
7
Rails, Transactions, and statements
Hi, I have a problem where I need an auto-incremented id back from the database for a statement that has yet to be committed. The operation that uses the id may fail, and if so, I need to rollback the database. I can''t figure out how to send only the statement to the database without the commit without sending over hard coded SQL. This is what I started out with: 1 def add_album
2008 Oct 13
4
Album art - requirements
On Mon, Oct 13, 2008 at 6:40 AM, Ivo Emanuel Gon?alves <justivo at gmail.com> wrote: > A good proposal, except for the fact most album art is JPEG. Not > forgetting either that, semantically, it's pretty bizarre to have > album art in a text format. I *desperately* want to provide the cover art for my own album in PDF format. Presently I provide JPG in the MP3s; at 72 DPI it
2008 May 10
4
Newbie: lambda do...end.should change(Model, :count).by(1). Doesn''t work
Hi to everyone, I''m an RSpec, and BDD in general, newbie so in order to learn I have chosen to use my personal website as a tesbed. I''m having difficulties juggling with mocks, and in particula with the following code. Here''s the controller action: def create @album = Album.new(params[:album]) if @album.save flash[:notice] = "album saved"
2004 Sep 10
1
[Flac-users] Grip, FLAC, and album replay gain
OK, here's a problem: I want to set the album replay gain in each track, but I'm using grip to rip and encode the tracks one by one. grip knows that all the tracks are on a single album, but FLAC sees them one at a time. I put the --replay-gain option on the FLAC command line, so it emits four comments into the vorbis commebnt block, e.g.: comment[9]:
2006 Jan 21
9
Where to put method
I''ve got following code in GenresHelper.rb def album_list(genre) albums = genre.albums.sort list = albums.collect { |album| link = link_to album.title, :controller => ''albums'', :action => ''show'',