Displaying 20 results from an estimated 100000 matches similar to: "Testing includes"
2007 Jan 21
1
Weirdness when save symbols to AR string fields
I have a model foo with two fields: id and string. When I try to save a
symbol into that string field I get weird results:
>> foo = Foo.new(:string => :foobar)
>> foo.string
=> :foobar
>> foo.save
>> foo.string
=> :foobar
>> foo = Foo.find(foo.id)
=> #<Foo:0x467282c @attributes={"id"=>5, "string"=>"---
2008 Mar 19
4
$("xxx") has no properties
hi!
I must miss something really essential that the following doesnt work:
I have a haml layout which includes the default javascripts, and the
application.js looks like this:
$("foobar").addClassName(''blue'');
the view looks like this:
<div id="foobar" class="green">testtest</div>
if I navigate to the site, I get the error
2008 Sep 01
4
Generating Images/PDF Server-Side
Hi,
I am working on a project where I need to generate a chart (a bit like a
pie chart, but very customised) and insert this into a PDF document.
Does anybody have any advice on ruby libraries (or other techniques) for
doing this? Open to suggestions?
The resulting PDF will be designed for printing and so ideally should be
vector throughout (or any raster images 300dpi). I was thinking of some
2007 Jan 29
3
Eager Loading: Stacking Includes?
Is it possible to stack :include''s in a situation like this:
A has_many Bs
B belongs_to A
B has_many Cs
C belongs_to B
The result of the query looking something like...
A.id B.id C.id
0 0 0
0 0 1
0 0 2
0 1 0
...
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you
2008 May 06
3
Capistrano: chmod 600 database.yml
Would it be wise to chmod 600 your database.yml file using Capistrano
when deploying seeing as it contains your mysql db in plain text?
~ Mark
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2006 Dec 22
2
erubis on rails
Hey,
Just thought I''d see how easy it was to use erubis rather than erb in
rails, and so far all seems to be pretty easy. Just added a few lines in
environment.rb and everything works as before.
However, one page is causing a problem. It is a partial that is being
passed a local variable. erubis doesn''t seem to see the local, and gives
the following error?
undefined local
2006 Oct 11
0
storing typo sessions in memcache
I was trying to use memcache for session storage in Typo. And i got
following error, when user logs into the system.
Session ID:
Cookie set: is_admin=yes; path=/
Redirected to http://foobar.com:8002/admin/content
Completed in 0.02042 (48 reqs/sec) | DB: 0.00236 (11%) | 302 Found
[http://foobar.com/accounts/login]
undefined class/module User
2007 Jan 26
1
rake test:x recreates tables in MySQL with server (not database) charset and collation
Any thoughts on how to avoid this problem? Already tried:
1. Setting the charset and collation in migration 001 - no effect:
def self.up
db_name = ActiveRecord::Base::connection.current_database()
execute "ALTER DATABASE #{db_name} CHARACTER SET utf8 COLLATE
utf8_bin"
end
2. Setting the charset and collation on each table individually - no
effect:
2007 Oct 11
2
relative_url_root and javascript_include_tag
Hi. In my environment.rb, I have:
ActionController::AbstractRequest.relative_url_root = "/foobar"
In my layout, I have:
<%= javascript_include_tag :defaults %>
Question 1:
I am getting an error:
ActionController::RoutingError (no route found to match
"/javascripts/prototype.js" with {:method=>:get}):
When I remove the relative_url_root, everything works great.
2007 Feb 13
4
PDF Thumbnail - RMagick
Hi,
I need to create a preview of a PDF upload to a CMS I''m building. Does
anyone know how to create a thumbnail of the first page of a PDF using
RMagick?
Any ideas welcome,
~ Mark
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"
2008 Jul 14
3
How to assert a simple link (testing)
<%= link_to ''my_profile'',:controller => ''users'', :action => ''show'', :id
=> current_user.id %>
<a href=''http://localhost:3000/users/show/2''>my_profile</a>
What is the easy and simple way to assert this link in testing.
--
Posted via http://www.ruby-forum.com/.
2007 Apr 18
3
' X is not missing constant Y ' , problem after rails update
Hello,
I''m just updating my rails version to 1.2.3
I get the '' X is not missing constant Y'' message for all request in my
existing applications.
Exemple :
app/controller/login/login.rb
use a model in :
app/models/login/connect.rb
This exemple give the error :
" Login is not missing constant Connect! "
What''s wrong im my configuration ?
--
2007 Oct 15
5
Very simple code throwing "uninitialized constant" error
This code works on an older version of Ruby and Rails but not with
Ruby 1.8.6 and Rails 1.2.5. The code is so simple that I can''t figure
out where the problem is.
profile_controller.rb
class ProfileController < ApplicationController
def show
@profile = Profile.find_by_school_id(params[:id])
end
end
-----------------------------------------------------------
profile.rb
class
2006 Nov 04
2
Possible to use attr_reader/writer in model?
I have some properties that I want setable externally, but readable only
internally. I''ve played around with attr_writer (and attr_reader
separately) but can''t figure out how to get either to work. I can do
what I want using attr_accessor, or just straight out defining the prop
setter method. Anybody know how to use attr_writer or attr_reader with a
model?
You da man,
Joe
2008 Jun 20
0
BitNami RubyStack now includes Git, Nginx and ruby19
We took into account your requests and RubyStack 1.2 includes updated
components, additionally nginx + nginx fair proxy balancer module, git,
ruby19 and many new useful gems. It is available for Linux, OS X and
Windows. Give it a try now and let us know what you think!
http://bitnami.org/article/new-rubystack-released
--
Posted via http://www.ruby-forum.com/.
2008 Aug 23
0
Why ActionController::Base.class_eval for includes?
Just out of curiosity, why does action_controller.rb include classes
with class_eval instead of directly? I.e., why
ActionController::Base.class_eval do
include ActionController::Flash
include ActionController::Filters
...
end
instead of just
class ActionController::Base
include ActionController::Flash
include ActionController::Filters
...
end
--
Posted via
2007 Aug 06
0
Problem generating scaffold with a namespace
I''m trying to generate a scaffold based on a model in a namespace and
I would like the controller to have a similar namespace.
Am I thinking that scaffold should be doing something it doesn''t or is
this a bug?
rails version: 1.2.3
ruby version: 1.8.5
OS: OS X 10.4.10
Created a model using
> script/generate model Foo::Bar
creates the model bar.rb in the model/foo directory
2006 Nov 08
0
routing error does not get caught by rescue_action_in_public
I have this in my application controller.
def rescue_action_in_public(exception)
logger.error("rescue_action_in_public executed")
case exception
when ActiveRecord::RecordNotFound,
::ActionController::UnknownAction,
::ActionController::RoutingError
logger.warn("rendering 404 page")
render(:file =>
2008 Aug 24
3
tricky include question
I''ve been here before and maybe I''m trying to do something that is not
possible. I am trying to include tables that are associated to other
tables in the actual include statement but not to the original table
call. In this case the furnii table.
this is my original query
@furnii_from_furnii = Furni.find :all, :include =>[:raider, {:imageasset
=> :skin}], :conditions =>
2007 Feb 15
2
Session not maintained - Please help
Hi,
I''ve recently developed a website with ruby on rails, I''ve uploaded the
website to my Servage account, after many hours i managed to get it to
run on that host. The problem i now have is that Rails sessions are not
maintained from page to page, the cookie is, as I''ve set it to expire
only way into the future. I''ve tried various folder permission setting
for