Displaying 20 results from an estimated 1000 matches similar to: "deep inspecting attributes"
2006 Jan 19
3
template/variable confusion
Hi there,
I''m having some trouble working out where/when I can define template variables.
I have a standard.rhtml layout template which is used across the application as the main xhtml wrapper.
Inside there is some code like this:
<div id="<%= @layout_style %>">
<%= @content_for_layout %>
</div>
Now content_for_layout always works fine, but
2006 Jan 23
11
mysql dates
does anyone know of a way to make the date_helper deal with mysql dates with 00 values in them?
I have lots of dates that are like the following:
2005-04-00
2005-00-00
and I need to set null values in a date_select for elements that are 00. These are valid dates in mysql.
In the absence of an immediate solution to the above, I''ve been trying to find out how InstanceTag.new works so I can
2006 Jan 23
2
require rmagick
Hello,
I''m trying to use rmagick in a helper script (for auto-generating image sizes) and I''m not sure where I should be calling ''require''.
currently I have:
require ''RMagick'' at the top of my controller:
class FilmsController < ApplicationController
require ''RMagick''
but that''s giving me an error:
2006 Jan 19
4
PHP ob_start in Ruby
I need to include Content-Length in each file. In PHP it would be:
<?php
ob_start();
?>
html
<?php
header(''Content-Length: '' . ob_get_length()); ob_end_flush();
?>
How can I do the same in Ruby?
Thanks,
eduard
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2006 Jan 18
1
using unique varchar instead of id
Hi,
I just signed up so ''hello everybody''.
As the title suggests, I was wondering if there was an easy way to specify that I want all actions/controls to be based upon a particular parameter rather than :id (in this case :unique_name). I don''t :id to appear in URLs or elsewhere, I want it all to work from :unique_name.
It seems like something that I should be able to
2006 Jan 26
0
setting default on "has_one" failure
Hi there,
I have a model for a Film, which:
has_and_belongs_to_many :artists
has_many :stills
has_one :preview_image,
:class_name => "Still",
:conditions => "priority=''main''"
the has_one:preview_image and has_many:stills obviously draw from the same table.
I was
2006 Jan 25
0
InstanceTag
Hi,
I''ve been prying my way around form helpers and I need to do something very similar to date_select. I was thinking I might be able tailor it to suit my purposes and then came upon InstanceTag.new with a call to_date_select_tag at the end.
I can''t find any mention of these anywhere else - can anyone give me any pointers as to what these two things do?
thanks dorian
--
I do
2006 Jan 19
0
setting helper defaults
Hi,
I''ve trawled the docs and the wiki, and I''m wondering if it''s possible to set an option globally on a helper (within a given controller) (DateHelper in theis instance).
I know beforehand that I''ll always want :include_blank => true, :start_year => 1991 and I have a lot of date fields.
This possible?
thanks in adv.
d
--
I do things for love or
2006 May 20
1
RJS returned javascript written straight to page
hi there,
I have in my controller, the following to catch a link_to_remote:
def form_part_add_personnel
@credit_types = CreditType.find(:all)
p = Credit.new()
p.id = rand.to_s[2..-1]
render :update do |page|
page.insert_html :bottom,
"script",
:partial => ''films/form/personnel'',
2006 May 18
1
ActiveRecord problems from within template
Hi,
my Film model has this:
has_many :live_action_personnel,
:class_name => "Credit",
:include => :credit_type,
:order => ''credit_types.position, credits.position ASC'',
:group => ''credit_types.personnel_type'',
2006 Apr 25
3
limiting options in file_upload
Does anyone know if it''s possible to set constraints to the size & type of file that file_column will accept?
I''d like to limit to image files of less than 2MB.
If this isn''t possible with file_column, is there a graceful way of getting the controller to handle it?
thanks
dorian
--
--
I do things for love or money
2006 Mar 29
0
routes and caching
Hi there,
I have the following route in my routes file:
# - all film sub-pages (defaulting to index.html)
map.connect ''films/:film_title/:page'',
:controller => ''films'',
:action => ''show'',
:page => ''index.html''
which will pick up URLs like this:
2006 Jun 15
5
Cannot invoke ActiveRecord subclass accessors in DRb worker
Hi there,
I''m trying to create a worker to do some asynchronous web client work
and update the data model with its results. It seems, however, that
every call I make to an ActiveRecord subclass causes the whole thing
to block. At least I think it''s blocked. Right now I''m just using
debug log output.
Is there a decent way to debug/test workers I can try?
Is there any
2008 Oct 22
2
smbd high cpu load
We have a Linux file server for a set of computer science and
engineering
labs where each lab contains machines running Mac OS X, Ubuntu Linux,
or some incarnation of Windows. At times the these machines become
almost unusable and I think I have narrowed the problem to smbd
processes
soaking up all the CPU on the server. Running 'top' on the server
reveals a dozen or so entries like
2006 Apr 28
2
tests and login_engine
Hi there,
I just started writing tests today after some months of using rails (slap wrists).
I seem to be getting the hang of things, but I''m hitting a wall when it comes to functional_testing pages protected by login_engine/user_engine.
all my assertions come back with:
Expected response to be a <:success>, but was <302>
Is there a way I can login from within a test?
2006 May 11
4
/public content security
Hello all,
I have a question regarding the security of my new web zine. The
idea is that I have editors that can log into the site, and then upload
comics in the form of a jpg. The way that I have this set up right now
is that the jpg is submitted through a form and then placed into the
authors sub directory in public/comics/. The record of the jpg is
stored in a pendingcomics table
2006 Mar 20
3
login_engine
Hello,
I''m having trouble getting login_engine to work properly. I get the standard login/registration views, but whenever I try to register I get:
NoMethodError in User#signup
undefined method `password_confirmation='' for #<User:0x408b2f9c>
I have login_engine, and engines installed from cvs:
http://opensvn.csie.org/rails_engines/plugins/
anyone else had anything
2006 Mar 15
1
file_column imagemagick strangeness
Hi,
I''m using the basic magick features of file_column,
and while files are uploading fine without the magick options, as soon as I do something like
:magick => { :size => "400x600" }
I get an ''invalid file'' error.
Further investigation reveals that the file is in fact invalid because something somewhere is truncating the file path:
2006 Apr 04
3
newbie - HABTM problems writing to Join Table in SQL
I am attempting to document a join between two tables. There seems to be
no writing to my database. Please help me out it is driving me absolutly
crazy.
Basically i''ve got a table of directors that is called when the new/edit
controller model for films is activated. It shows the user a selectable
list of directors they can apply to films. The problem is in the
update/create part. I
2006 Jun 02
6
overriding constants
Hi there,
I''m trying to override the defaults for form_helper.
I can see in action_view/helpers/form_helper.rb:
class InstanceTag #:nodoc:
include Helpers::TagHelper
attr_reader :method_name, :object_name
DEFAULT_FIELD_OPTIONS = { "size" => 30 }.freeze unless const_defined?(:DEFAULT_FIELD_OPTIONS)
DEFAULT_RADIO_OPTIONS = { }.freeze