Displaying 20 results from an estimated 10000 matches similar to: "Routing to a static HTML file under RAILS_ROOT"
2006 Mar 27
3
regular expression matching in routes.rb
All,
I have a route specified as:
map.connect '':folder/:filename'', :folder => /htmlfiles/, :controller =>
"eSimply", :action => "preview_HTML"
I expect it to invoke the "preview_HTML" action in the "eSimply"
controller.
Given an argument of "htmlfiles/xyz.html", it keeps saying that it can''t
find an
2006 Jul 03
2
1.1.4: link_to with mixed case controller names "broken"?
I have a side navigation bar with links embedded in it like the
following:
<%= link_to( ''Create Job'',
{ :controller => ''eSimply'',
:action => ''upload'' }) %>
This link now shows a routing exception
Recognition failed for "/eSimply/upload"
This link has worked for over through Rails
2006 Apr 13
1
Setting CWD to be RAILS_ROOT for fastcgi/Apache
All,
So I''ve discovered that when running on FastCGI with Apache and the
working directory for the process is actually the "public" directory
under RAILS_ROOT.
Is there a way to force the current working directory to be RAILS_ROOT
for the FastCGI procs so that file manipulation would then be done
relative to RAILS_ROOT?
Or should I just make sure that all of my paths are
2006 Mar 22
2
How to bypass routing for a particular request?
I would like to set up some my app. to display a standalone HTML page -
not rendered through RoR per se.
Something like
render(:inline => some_Javascript_function...
then in the Javascript
some_Javascript_function,
I want to open up a popup with the URL I specify. However, because it
is a relative URL, it is going through the RoR routing algorithm. I
don''t want that - can I
2006 Mar 20
5
Wrap error_messages_for() call when no instance var present
I am trying to put some smarts around a call to
<%= error_messages_for %>
so that when I first come into this page i.e. when my instance variable
@target_list has not been defined yet, the page doesn''t break.
I''m doing this:
<% if @target_list? %>
<%= error_messages_for ''target_list'' %>
<% end %>
I get a syntax error on line 1.
2006 Mar 22
2
Successfully importing Rubyful Soup objects
All,
At the top of my controller, I have:
require ''rubygems''
require_gem ''rubyful_soup''
The rubyful_soup gem has been successfully installed.
However, when I go to instantiate a class from it, using
parser = BeautifulSoup.new(html)
I get
uninitialized constant BeautifulSoup
Is there something else I need to do to see the symbols in the Rubyful
Soup gem?
2006 Mar 18
9
Using <%= text_field %> within partials is problematic
All,
Thanks for any help in advance.
I have what I think is a very straightforward partial template and I
can''t figure out why a text_field call within it doesn''t work.
Here is my calling template: lists.rhtml
<div id="target_lists">
<%= render(:partial => "target_lists", :collection => @target_lists)
%>
</div>
In the partial
2006 Apr 18
4
Security considerations with displaying uploaded HTML
I have an application where I am allowing users to upload (or refer the
app. to) arbritrary HTML that I am (currently) displaying in an IFRAME
on a page. The users will be authenticated so it''s not open to the
entire universe.
I was always uneasy with this, but after reading the security chapter of
AWDWR, I am even more concerned.
What kinds of applications do people have out there
2006 Jul 05
7
HABTM join table has an "ID" column - is this an issue?
All,
I''m building model objects for existing tables that I cannot modify.
In AWDWR, Dave says "Note that our join table has no id column...The
second reason for not including an id column in the join table is that
AR automatically includes all columns from the join tables when
accessing rows using it. If the join table included a column called id,
its id would overwrite the id
2006 Aug 03
1
Is it possible to interpolating variables in YAML files?
I''m attempting to store a value that''s dependent on an environment
variable in a custom .yml file, like so:
job_folder: "#{RAILS_ROOT}/jobs"
Doesn''t seem to like that. Is there any way for me to have access to
the RAILS_ROOT environment variable from inside of my configuration
file?
Thanks,
Wes
--
Posted via http://www.ruby-forum.com/.
2006 Apr 24
1
How to require a regular module into my controller?
I created a modules directory under my app. root (RAILS_ROOT/app)
I''m trying to "require in" a module in that directory into my
controller.
I tried require ''modules/module.rb''
I tried require "#{RAILS_ROOT}/app/modules/ESimplyUtil"
The module file is in modules/ESimplyUtil.rb. Is that the right name?
Neither of these works.
How can I
2006 Jul 10
8
Setup new data in the test database _after_ unit test runs
All,
I want to run automated unit tests as part of my build. I am building
to my test environment. Upon successful completion of all of my unit
tests, I would then like to load some data (using a fixture, I imagine)
into my test database that will act as fresh "system test" data for my
users to play with.
What is the best way to "load the standard system test/user acceptance
2006 Apr 13
4
Apache/fastcgi setup can''t find custom config/*.yml file!
All,
Apache 2/FastCGI on Linux
My fastcgi config. file is set up to run the "test" RAILS_ENV.
When I go to access a view associated with a particular controller, I
keep getting a ENOENT (file not found) error on a custom config. file
that I am attempting to load.
What I can''t figure out is why it can''t find the file.
Here''s the code that loads it in my
2006 Apr 12
2
IO.read fails on relative path in model object
All,
I am attempting to do an IO.read call on a file inside of one of my
model objects.
I keep getting Errno::ENOENT
The path I''m passing to IO.read is relative to RAILS_ROOT.
Two questions:
1) This code was previously executing in my controller - it it
significant that I moved it into my model?
2) Is there some way to verify which directory is the current directory
for the
2006 Jul 13
5
Generic page element display initializer in a layout?
All,
I''ve run into a snag. I need to handle the display of elements on my
page and I want to use my Javascript event handlers on page load.
However, my BODY tag is trapped in my generic layout.
I''m thinking that I can put an onLoad on the BODY tag that will just
call a Javascript method called initializePage() and then provide this
initializePage() call in my specific page
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
2006 Jul 03
2
Routing acting strangely - mixed case controller names fail?
All,
I have a link that used to work but now generates a routing error. The
link URL is a straightforward controller/action/id and of course, I have
map.connect '':controller/:action/:id''
in my routes.rb file.
When I click on this link, I get a routing error. What''s potentially
interesting about this URL is that the controller name is mixed case.
Class is
2006 Jul 14
7
Form validation - keepin correct fields displayed on refresh
All,
I''m finally doing my first real form in Rails - the model object that
I''m entering information for has 8 validations so far.
If I type in good values for all the fields but one, I get the pretty
validation, and the nice field highlighting, but all of the fields are
cleared, forcing me to retype all of that info. That is a big drag.
Is there a standard way to get the
2006 Jun 27
25
1.1.3 available.
Hello,
DHH has just announced the release of Rails 1.1.3
http://weblog.rubyonrails.org/2006/6/27/rails-1-1-3-security-fix-and-minor-fixes
rails-1.1.3
activerecord-1.14.3
actionpack-1.12.2
actionmailer-1.2.2
actionwebservice-1.1.3
The announce without the repetition :)
"Rails 1.1.3: Security fix and minor fixes
Posted by David June 27, 2006 @ 08:07PM
We''ve found and fixed a
2006 Aug 09
10
Is there QA on Rails gem releases?
The ActionMailer/ActionPack gem release is still screwed up.
Does someone test the gem releases to ensure that they work?
Just an idea.
Wes
--
Posted via http://www.ruby-forum.com/.