Displaying 20 results from an estimated 8000 matches similar to: "Normality tests"
2006 Apr 24
2
Checkboxes - Saving a Checked record to another table
I am displaying a bunch of records from a table called "assets". Next
to each record i have a checkbox. When this box is checked i want to be
able to save the id of the record into another table called
"flagged_assets". All I need is the ID, nothing else. Im struggling
with the logic to save to another table. I know how to do it if the
asset_id is already in the
2006 Apr 18
6
Help with Forms
Hello,
Ive been trying to sort out this problem for a couple of days now.
Here''s my problem:
Im builing an ajax form that has a repetitive sequence of similar form
elements (tracking_id).
<%= text_field "asset", "tracking_id", "index" => i, "class" => "case"
%>
<%= text_field "asset", "tracking_id",
2005 Dec 02
3
Conceptual Design Question
Hi All,
I am making a DAM (seems to be the hip thing to do these days). It is
for the company that I work for. We have some really weird domain
rules that have prevented me from just using a simple directory
structure file permission system. I have come up with a solution but I
wanted to run it by you gurus to ensure that I am not recompiling the
wheel here.
Basically the domain rule is:
A user
2006 Apr 24
4
Joined search returns NIL ids
I have two models: assets and makes. Make has many assets and an asset
belongs to one make.
I am calling this part of my asset controller from a search form with
the parameters "search" (search term) and "field" (database field
heading) which then renders a partial with the search results on it.
########################################################
if
2012 Aug 04
6
Automatic asset paths prevent logical asset organization
In 2fe70c1 (last year), rails changed from a static list of assets.paths to automatically register any path under assets/*. (This was not reflected in Rails Guides so I pushed an update to docrails.)
However, in my opinion, these automatic asset paths create confusion.
The result is that the first-level directories under `(app|lib|vendor)/assets` get swallowed and if I put assets into a
2012 Mar 20
4
Multiple Paperclip Images on Index
Hi,
I am working on a project that is using Paperclip to upload multiple
images to an Asset model. my Post model has_many Assets. As per this
tutorial/screencast...
https://github.com/Emerson/Multiple-File-Uploads-with-Paperclip-and-Rails-3/blob/master/app/views/posts/show.html.erb">
http://www.emersonlackey.com/article/paperclip-with-rails-3>
This all works fine and I can
2012 Dec 18
2
cache-busting non-digest assets in sprockets in development a good idea? should headers in sprockets be configurable?
Just monkey patched Sprockets in our Rails 3.2.9 app to override the
Cache-Control header for html assets that we need to tweak more often in
development, but that we don''t want to use digests/fingerprinting with:
# Sprockets 2.x patch
if Rails.env.development?
module Sprockets
module Server
private
alias_method :sprockets_headers, :headers
def headers(env,
2004 Oct 03
1
How might one write this better?
I am trying to simulate the trajectory of the pension assets of one
person. In C-like syntax, it looks like this:
daily.wage.growth = 1.001 # deterministic
contribution.rate = 0.08 # deterministic 8%
Wage = 10 # initial
Asset = 0 # initial
for (10,000 days) {
Asset += contribution.rate * Wage
2007 May 28
2
Rails, respond_to? over anonymous module (extend has_many).
Hello List,
I''m trying to generate examples for some list-helpers I have coded
which use in my projects.
Basically, the Playlist class uses one anonymous module in has_many
that acts as helper between acts_as_list and my desired API:
class Playlist < ActiveRecord::Base
# associations go here
has_many :playlist_items, :order => :position, :dependent => :destroy
has_many
2007 Dec 20
3
ActiveRecords Eager Loading
Hi,
I am doing an eager loading in ruby on rails using below statement
------------------------
Article.find(:all, :include => [:asset, :vote],
:conditions=>"assets.parent_id is null",
:order=>"stat_final_ranking desc", :limit=>20)
---------------------------------------
the above statement resulted in this expensive query.
2012 Feb 15
2
Control number of assets in resulting portfolio with optimizations using package fPortfolio
Dear All,
I am using package fPortfolio to run minimum variance portfolio
optimizations in R. I already know how to set portfolioSpecs, portfolio
objects and constraints. Unfortunately I am not able to set the following
type of constraints.
I have a timeSeries object with returns data for roughly 1.5k assets for 261
subperiods (workingdays) and want to compute the global minimum variance
2007 Jun 26
4
Can I stub a method on a belongs_to association:
describe Asset, " when destroyed" do
fixtures :assets, :videos, :sites, :publish_settings
before(:each) do
@asset = assets(:test_asset)
@mock_hook = mock("hook")
@asset.video.stub!(:hook).and_return @mock_hook # error occurs here
end
it "should call the delete hook" do
@mock_hook.should_receive(:update).with("test_video",
2008 Mar 13
3
Refreshing a page gives a "stack level too deep" error.
I''m converting our app into restful rails. A couple of my classes
(Resource and Asset) have a has_many relationship with each other -
here''s the routes:
map.resources :assets, :has_many=>[:resources]
map.resources :resources, :has_many=>[:assets]
I''m getting something weird in my view pages. When i go to
/resources/4/assets
it works. I go to the page
2011 Sep 18
12
3.1 asset pipeline + Capistrano troubles
Hello,
I''m having a bit of trouble with the asset pipeline and, I think,
Capistrano.
In my app layout I have:
<%= stylesheet_link_tag "application", "bootstrap" %>
And the relevant bits of the app dir structure are:
app/assets/stylesheets/application.css.scss # Contains ''require_self'' and
''require_tree .'' as usual
2012 Jan 29
1
AssetNotPrecompiledError for missing assets - really?
I migrated one of my projects to from Rails 3.0 to 3.2.1 which means
I''m using the asset pipeline for the first time.
As much as I like the ease of compressing and minifying my assets the
more I''m annoyed about its behavior to raise an
AssetNotPrecompiledError as soon as, well, there''s an asset that''s not
precompiled.
Can somebody explain me the reason why this
2006 Jul 20
5
How can I make has_many prevent a delete that would lead to orphans?
e.g.
class Asset < ActiveRecord::Base
validates_presence_of :asset_number, :make, :model, :location,
:name, :serial_number
validates_numericality_of :asset_number
validates_uniqueness_of :asset_number
belongs_to :user
belongs_to :location
belongs_to :asset_type, :foreign_key => ''type_id''
end
class Location < ActiveRecord::Base
validates_presence_of :name
2009 Oct 27
5
Unwanted call to validates_associated
In my schema, a question has_many :answers. When the validations are
run on a question, and one of the answers is not valid, then i get
"Answers is not valid"
coming out of errors.full_messages. I don''t want this, i''m already
testing the validity of the answers and this is an ugly and
uninformative error message. It looks like it''s the message i would get
2006 Oct 10
2
Ferret returning too many results
Hi, I just upgraded from acts_as_ferret 0.2/Ferret 0.9.x to
acts_as_ferret 0.3/ferret .10.9, and i''m getting a strange behavior:
searches are returning far too many results, most of them superflous.
i''ll paste in my code below, it''s pretty simple. i''m googling like mad,
and going through both the source and the forums, and having trouble
finding what could
2012 Sep 04
10
Generic asset definitions and management
(The following is not a Rails-specific question, but relates to a problem
that affects Rails, so I wonder whether anyone on the team has an opinion
about it or knows whether a solution is already in development.)
While gem dependencies can be easily managed in a Gemfile by Bundler, when
it comes to other assets, you either have to manually copy javascript files
into the app/assets or vendor
2006 Aug 06
1
Sorting through relationships
Hi,
I''m having a rather annoying problem which can only be explained with
an example, so here we go.
I have a Person class which has_many :assets. An Asset has_one :game.
I would like every Person''s asset to be sorted by its game''s title,
similar to this:
has_many :assets, :order => ''game.title''
That doesn''t seem to work. A