Displaying 20 results from an estimated 20000 matches similar to: "[Q] How run Custom code on each request/action"
2006 Feb 02
4
How switching global layout (application.rthml <or> custom.rhtml)
Dears,
My railsapp run using ''/layout/application.rhtml'' and under some
conditions ( Authenticated user, url parameter) I like to switch
globally to another layout, let''s say custom.rhtml
Like :
class AppController < ApplicationController
before_filter :context_layout
def index
end
end
# application.rb
def context_layout
if <context_condition>
2006 Jan 09
6
Rendering dynamic Gruff image (send_data)
Dears,
Got a controller witch do a send_data for displaying a chart.
like :
send_data(g.to_blob, :filename => "any.png", :type => ''image/png'',
:disposition=> ''inline'')
I actually do a
<img src="http://myhost:3000/stats/make_graph" />
Is there any way more clean to do that ? At minima don''t hardcode the
beginning
2006 Jul 27
3
A number (id?) is added after css/js tags like style.css?1154009736
Dears,
My Ror setup works.. but I can''t guess why
<%= stylesheet_link_tag ''style'' , :media=> ''screen''%>
is rended as
<link href="/stylesheets/style.css?1154009736" media="screen"
rel="Stylesheet" type="text/css" />
What is that number.. any usage ??
Or I misconfigured something ?
Thanks
2006 Feb 28
3
[AR] #{id} namespace visibility used in finder_sql
Dears,
[Rails 1.0.0]
I''m working with a legacy schema, and around my 20+ models i''ve used
some AR constructs.
They are based on a finder_sql doing some dirty sql and using #{id}
from the ''pivot'' model for extracting data in other tables.
like :
class Division < ActiveRecord::Base
set_table_name "legacy_division"
set_primary_key
2005 Dec 29
4
Paginate do a Count(*) request before, how access that count value.
Hello,
AV::paginate query first by a count, how access this value in the
controller or view ?
Why ?
Because I''ll like to display the total number or records found w/o
doing another expenssive Count.
Thanks,
2006 Feb 01
3
Getting database config info
Hi folks. I have a very small problem which is probably very simple. But
I''ve scoured the api and the rails book with no luck.
I''m trying to get information about the database definition out of active
record. When I go into console and say
ActiveRecord::Base.connection
I get a MysqlAdapter object, with an instance variable called @config that''s
a hash containing all
2005 Dec 05
1
Lack of 'LEFT JOIN' in Oracle 8, any patch for theta style (+)
Dears,
Oracle 8 don''t support ANSI syntax with :
SELECT e.emp_id,
e.fname,
e.lname,
j.jobdesc
FROM employe e
LEFT JOIN jobs j ON e.job_id = j.job_id
but only
SELECT e.emp_id,
e.fname,
e.lname,
j.jobdesc
FROM employe e,
jobs j
WHERE j.job_id (+) = e.job_id
JOIN syntax came with 9i.
Anyone patched Rails
2005 Dec 21
7
use of SET command in find_by_sql
Hi,
I''m trying to execute something like this method in a model:
def self.sql_for_rankings()
sql = "SET @counter:=0;"
sql << " SET @counter:=0;
SELECT *, @counter:=@counter+1 AS rank
FROM testscores. "
find_by_sql(sql)
end
Where the new rank column is a kind of autoincrementer inside of
2006 Aug 02
15
Rails in a Windows World
I work at an organization that is very wrapped up in Microsoft products. I
am trying to get a test application put in however I''m not sure what to do
about the infratstructure. If it were up to me we would put in MySQL and
Apache or Lighty, however its not up to me. The easiest way to get an
application into production at our company would be to use the existing MS
SQL server and IIS
2006 Apr 04
21
Rails on IIS
I just spent the last two days trying to get Rails on IIS to work with
Windows 2003/IIS 6.0. I think I''ve finally got it working, but it took
more googling than I care to describe. Now I''ve got a few questions:
1) Is there some ''official'' Rails on IIS guide on this site on another
official ruby site that''s known to work well?
2) If not, can someone
2006 Jul 06
4
Oracle HR on Rails
Interesting read...apologies if it has been posted already.
http://www.oracle.com/technology/pub/articles/saternos-rails.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060706/619e650a/attachment.html
2006 Apr 27
6
How to trim a string?
This must be really simple but I have looked everywhere.
I have a <%= item.description -% in my view and I want to trim it to 10
words.
The description can be long and I want to trim this in my preview?
--
Posted via http://www.ruby-forum.com/.
2005 Dec 21
1
Are Ducks Hibernating ?
Dears,
Remembering last value in a select box don''t work for me as :
Controller :
@years=(1970..2005).to_a
Form:
<%= select_tag "year", options_for_select( (2001..2005).to_a,
@params[:year] ) %>
I had to write
<%= select_tag "year", options_for_select( (2001..2005).to_a,
@params[:year].to_i ) %>
for it works.
Not important, but I''m
2005 Mar 08
43
e=MCv
Dears,
What is this software runned as "e" showed on most Rails Videos and
providing a tree browser (explorer) and editor ?
Avail for Linux ?
Gretz
--
Mathieu
2006 Mar 01
7
Oracle Sequence & Rails
the compiler tell me it:
invalid column name: INSERT INTO ago.prova_stats (cognome, nome, id,
telefono) VALUES(''Medda'', ''Ivan'', :id, 70565611)
where ago.prova_stats is the table used by me and that have only the
columns ''cognome'',''nome'' and ''telefono''.
My table hasn''t the column
2006 Feb 01
5
Apache 2.2 don''t work with fastcgi
I''m trying to install mod_fastcgi for my rails app.
I use Apache 2.2 and FastCGI 2.4.2 in windows xp.
I have modified the httpd.conf adding LoadModule fastcgi_module
modules/mod_fastcgi.dll (with mod_fastcgi.dll and mod_fastcgi.so in the
modules directory).
Whe i try to start Apache i have this error
----------------------------
apache: Syntax error on line 122 of
2006 Feb 28
19
Session magic question
Greetings!
I could really use some help understanding what Rails puts into the session store related to the objects it creates. I''ve found documentation on how _I_ can put / get info into it, but can''t find the docs on what _Rails_ puts into it.
I''ve got a simple app that collects some data from the user, stores it in a db record, allows the user to edit it, display
2006 Feb 27
2
[Q] Active Ducking
Hello,
I work with a legacy schema, thanks to Rails it''s not too difficult
out of the ID''s and plurals rules.
Got two tables (senders and receivers), they are identical in
structure like, just fieldnames are differents
SENDID number
SENDNAME varchar
SENDADDR varchar
../snip
RECVID number
SENDNAME varchar
SENDADDR varchar
../snip
I try to create a receiver from a
2006 Mar 31
1
Oracle 8 to 9 strange performance issue
Hello,
Got Ruby 1.8.2, RAILS 1.0, Windows2kx and Ruby-OCI8.mswin (1.1.3)
I try a migration test drive for one legacy DB from an original Ora
win32 8.1.7 server to a better hardware running Win32 Oracle 9.2.
The two DB have 99,999% identical datas.
My rails app run on a independant serveur (W2003) using an Oracle
Client 8.1.7. I''ve the same results using IIS/FastCgi or script/server
2006 Jan 05
4
Apache2 and popen
I''m running Apache2 on windows and I have a controller that issues a popen.
class FileController < ApplicationController
def index
f = IO.popen("dir")
@files = f.readlines
end
end
This works using webbrick but on Apache produces...
----------
Errno::ENOENT in File#index
No such file or directory - dir
RAILS_ROOT: C:/www/teensymud/public/../config/..