Displaying 20 results from an estimated 30000 matches similar to: "How to access virtual attributes in the model"
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
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
2010 Oct 12
2
STI and :through, not working?
Artist.first.medias returns all medias. Media is an STI. Media can be
video or painting.
How do I return all paintings of an artist? Only paintings, not
videos?
In my Artist model, I tried putting:
has_many :paintings, :through => :medias
In console, I do:
Artist.first.paintings.all
And I get:
ActiveRecord::HasManyThroughSourceAssociationNotFoundError: Could
not find the source
2010 Oct 15
1
Help with nested form: User and Artist
Artist is 1:1 with User. User has_one :artist
In my artist model, I have:
belongs_to :user
accepts_nested_attributes_for :user
However, in my artist _form, the name column from the user model does
not display. I am doing:
<% f.fields_for :user do |builder| %>
<p class="fields">
<%= builder.label :name %>
<%= builder.text_field :name %>
2010 Sep 08
4
OpenSSL
Hello anyone used OpenSSL before?
Why do we need to pay for expensive SSL certs when there is OpenSSL
which is provided free? Is there a difference?
I''ve got an ecommerce website, and wondering if OpenSSL is enough?
Your thoughts will be appreciated
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this
2010 Oct 18
5
How to create a "like" button
Ive got a like and video model.
On a Video page, Users can click a link ("like") button which will
allow them to like a particular video.
Since my like button/image comes in the form of a link and not an
actual html form. How should this be implemented? Do I need to specify
a ":method => puts" in my link_to tag helper?
What are your thoughts?
--
You received this
2006 Jul 13
4
Does text_field go directly to attributes hash in AR object?
All,
I''m having a hell of a time figuring out what is going on here.
I''m trying to override one of my getters so that I can format it a
certain way in my form. But I can''t seem to get text_field to call the
appropriate method on my object.
So here''s my getter:
public
def FAX
fax = read_attribute(:FAX)
puts fax
2006 Feb 24
2
Formatting values of numbers using text_field
Anyone have a quick solution on how to format a number in a text_field
tag?
<% text_field "price", "amount" %> returns 100.0 and it would be nice
if it showed 100.00
Of course, number_with_precision works nicely, but how do you make that
work with text_field?
I thought maybe overriding the getter in the model. However, this means
I would have to bring the helper
2015 Nov 20
1
Good practice for naming classes, builders, attributes, getters/setters for object composition
Hey everyone,
I am developing a package and I am wondering if there is a good practice
for naming classes, builders, attributes getters and setters when dealing
with object composition. I know that it is usually a good practice to give
to the builder the same name as the class and, if possible, to avoid to use
upper case letters. My problem is that, when I build an object containing
an other
2006 Jan 25
1
deep inspecting attributes
Hi there,
in one of my templates I have the following code:
<% for film in @artist.films %>
<h3>films</h3>
<p><%= link_to film.title, :controller => ''films'', :action => ''showfilm'', :animate_title => film.animate_title, :page => ''synopsis'' %></p>
<% end %>
however if I do:
<%=
2019 Jul 23
2
[RFC] Optimization Remark for derived function / argument attributes
Hello all,
During the compilation process, LLVM automatically derives various
attributes about functions and values (for example that a pointer is
nonnull, a function is constant, etc) that are used within a translation
unit.
I propose adding a pass to LLVM that allows front-ends to output derived
attributes. Such a pass would be useful both for developers and end users
to debug programs,
2006 Jul 03
4
text_field doesn''t call overridden ActiveRecord getters
All,
In a template, I have
<%= text_field :target_list, :DateReceived,
{ :title => ''uploaded_at'',
:class =>
''target_list_info'',
:disabled => ''true'' } %>
Here is the DateReceived method on my
2008 Jun 02
3
Adviced way of tagging music
I change a lot of my CD to Ogg to be able to listen them easily from my
computer (I use foobar, I was used to WMP but it does not support library
for Ogg files and plug-ins I found for this where poor) without the need for
frequent CD changing.
I like my music to be richly tagged. But with classical music CD it is a
real pain to tag those files. Typical problems involve:
- single CD
2007 Aug 30
2
define-based exported virtual resources
Can you use exported virtual resources with custom definitions? As an
example, with the following definition:
define vr-tester() {
file {
"/tmp/vr-success.txt":
content => ''foobar'';
}
}
this code is working for me:
class testme {
@vr-tester { "foobar": ; }
Vr-tester <||>
}
but this is not:
class testme {
2011 Aug 12
1
Getting nil value when setting an on Join model via a has_many :through relationship
Hi All,
I''ve been trying to figure out what''s wrong here for a little over a
day and figured i''d reach out to the ROR list.
A pastie explains the code a bit better than directly in email:
http://pastie.org/private/mvu0zr1xm18bsk6nfbyama
Basically i have an Artist, and he has many Songs through a join model
called Releases. An artist can be "featured" on a
2004 Aug 06
1
metadata update is delayed for 2 songs
well
when i streamed the station using foobar.. then foobar2000 displayed the metadata correctly...
but at that time.. when i checked out status2.xml, stats.xsl and stats.xml , the metadata is displaced incorrectly.. two songs behind..
i've tested the stream broadcasting using winamp2, foobar200 w/ oddcast dsp plug in.
you can check out my station at http://ny.icecast.net:8646/play.ogg
2006 Jun 07
2
Problem with a setter that converts euros to cents
Hi,
I have some problems with an application where I''m using custom
accessors to do currency conversions. In my model, I have a price
attribute in the database that stores the value in cents, to avoid
future problems with float arithmetic and round. But at the views, I
would like to show the price in euros, with decimal for the cents. So
I defined a new attribute called price_in_euros,
2006 Jun 07
1
Setter that converts a float attribute to integer
Hi,
I have some problems with an application where I''m using custom
accessors to do currency conversions. In my model, I have a price
attribute in the database that stores the value in cents, to avoid
future problems with float arithmetic and round. But at the views, I
would like to show the price in euros, with decimal for the cents. So
I defined a new attribute called price_in_euros,
2000 Jun 16
2
Description of commits
Tonight's commits so far:
I finally wrote up the result of the comment header specification discussion.
It's in the doc/ directory now. I plan on doing work in the libvorbis comment
handling tonight to bring it up to date and make the interface more useful.
gif->png conversion of the images in the docs
Monty
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg
2010 Jul 27
1
Cyrus Virtual Domains: Domain migration from Cyrus
hi,
we want to migrate from Cyrus 2.x to Dovecot 1.x (!). We use the virtual
domain feature from Cyrus for a better disk partitioning:
/var/imap/domain.a/user/foo ..
/var/imap/domain.b/user/foo ..
/var/imap/domain.c/user/foo ..
In a exported skiplist DB, it shows like:
=================
domain.a!user.foobar 0 int foobar at domain.a lrswipcda postmaster at domain.a
domain.a!user.han 0 int han