Displaying 20 results from an estimated 45 matches for "root_path".
2006 Jan 17
3
file_column :root_path question.
...oying to FreeBSD+lighttpd using
Switchtower and I''ve got things generally working. My problem now is
that file_column data gets zapped every time I deploy, because
Switchtower creates a whole new myapp/public directory with each rev.
I looked through the file_column docs and found the :root_path option,
which I use in my models as follows:
class Foo < ActiveRecord::Base
if RAILS_ENV == ''production'' then
file_column :image, {:root_path =>
"/home/www/rails-apps/myapp-externals" }
else
file_column :image
end
end
This is kludgy and I don''t...
2008 May 21
3
How to access Rails::Configuration instance methods
There was a thread yesterday about ENV["_"] which is not available to
Windows,
I got to playing around with how to find access to the
initializer_path or in this case the root_path
My question is more about why I don''t have access to what appears to
be a public method than finding the root_path.
I did this in 2.0.2 with script/console
The Rails object has a Configuration class accessible via
Rails::Configuration
I have script console running and at the same time...
2006 Jan 17
0
file_column with both root_path and store_dir
I store my file_column database outside of my RAILS_ROOT.
It seems to work in real life, but not in tests.
In the tests, I can''t set both the root_path and the store_dir. In
tests, setting the store_dir option will override the root_path
option. The only way for root_path to work is to remove store_dir. I
think the problem is in file_column.rb on line 22:
options[:store_dir] ||= File.join(options[:root_path], model, attr)
Here''...
2006 Jun 28
6
file_column plugin. Storing files outside RAILS_ROOT
I also posted this on Rails Engines forum. Sorry for the double post.
I am trying to configure file_column plugin so that it stores the images
in a directory completely outside of RAILS_ROOT.
I have no problems in storing the files by setting :root_path option.
But I can''t get to display these images using ''url_for_file_column''.
What I get instead of the image is simply the filename.
Is this a bug in the plugin or am I not using it properly?
Thanks in advance,
Cagan
--
Posted via http://www.ruby-forum.com/.
2006 Apr 16
7
Problem running unit tests
I am running Rails 1.1.2 with Ruby 1.82-15. My database is Postgresql. I
haven''t had any problems generating models, migrations, using scaffolds, and
generally building and using my application, but I haven''t been able to get
testing to work. I initially just ignored the problem and kept developing,
but would like to add proper testing from here on out.
Currently when I type
2011 Feb 15
5
Path and Url
Hello everyone, what''s the real difference between root_url and root_path in
Rails, for example. Apparently both lead to the same route in the
application.
Thanks!
--
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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@p...
2009 Dec 02
14
root_path and root_url undefined
Hi all,
I''ve just started working on another RoR project after a couple of months
away. I''m having trouble with named routes, specifically root_*
In previous apps I''ve used root_path and root_url without any problems, but
in this project (2.3.2 - the same as my last project where I used it) it
comes up undefined.
I''ve double and triple checking my routes.rb, and it all appears fine. I''ve
defined map.root and removed index.html. I just can''t think wha...
2006 Mar 02
2
url_for_file_column not returning correct path
I added this test towards the end of the included
file_column_helper_test.rb that shipped with the file_column plugin:
def test_url_for_file_column_different_root_path
Entry.file_column :image, :root_path => File.join(RAILS_ROOT,
"public/files")
e = Entry.new(:image => upload(f("skanthak.png")))
assert_match %r{/public/files/entry/image}, e.image_options[:store_dir]
assert e.save
assert_match %r{files/entry/image}, ur...
2013 Apr 09
19
[PATCH 00/17] Btrfs-progs: some receive related patches
Most fixes are trivial.
The one from Alex is fixing a real bug that several users have reported.
Alex sent the patch half a year ago and it was not yet integrated.
The patch "Use /proc/mounts instead of /etc/mtab" is a repost.
The patch "btrfs-receive optionally honors the end-cmd" is a preparation
step to allow backup tools to multiplex a single communication stream
(e.g. a
2013 Apr 06
3
btrfs-progs: re-add send-test
...+#include "send-utils.h"
+#include "send-stream.h"
+#else
+#include <btrfs/send-utils.h>
+#include <btrfs/send-stream.h>
+#endif /* BTRFS_FLAT_INCLUDES */
+
+static int pipefd[2];
+struct btrfs_ioctl_send_args io_send = {0, };
+static char *subvol_path;
+static char *root_path;
+
+struct recv_args {
+ char *full_subvol_path;
+ char *root_path;
+};
+
+void usage(int error)
+{
+ printf("send-test <btrfs root> <subvol>\n");
+ if (error)
+ exit(error);
+}
+
+static int print_subvol(const char *path, const u8 *uuid, u64 ctransid,
+ void *user)
+{
+ st...
2003 Oct 15
3
OpenSSH package
A non-text attachment was scrubbed...
Name: not available
Type: text
Size: 7366 bytes
Desc: not available
Url : http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20031015/02b75f40/attachment.ksh
2006 Apr 11
18
Rails 1.1 in Production
My hosting company is still supporting only Rails 1.0. I have installed
Rails 1.1.2 to my vendor directory and deployed it in production which
should mean that my application should be using the Rails version in my
vendor diretory. But It looks like its still using local gem libraries, here
is the error from dispatch.fcgi when I try and invoke my app
NoMethodError (undefined method
2012 Nov 09
8
method conditional option pattern
When I have this pattern
sign_me(@user, :event => :authentication, :subdomain => subdomain)
how can I write it to avoid sending the :subdomain option if subdomain.nil?
( if possible ..)
sign_me(@user, :event => :authentication #?, :subdomain =>
subdomain unless subdomain.nil? )
--
You received this message because you are subscribed to the Google Groups
2007 Dec 29
5
./script/story command
...to others
using plain text stories right now, and also because I would like to
consider possibilities for getting this functionality into RSpec core.
WDYT?
--
Bryan Helmkamp
http://brynary.com -- My blog
-----------------------------------------------
#!/usr/bin/env ruby
class StoryCommand
ROOT_PATH = File.expand_path(File.dirname(__FILE__) + "/..")
STORIES_PATH = "#{ROOT_PATH}/stories/scenarios"
STEP_MATCHERS_PATH = "#{ROOT_PATH}/stories/steps"
HELPER_PATH = "#{ROOT_PATH}/stories/helper"
def self.run
self.new.run
end
d...
2011 Nov 12
4
No route matches [GET] "/microposts/304"
...ler < ApplicationController
before_filter :authenticate, :only => [:create, :destroy]
before_filter :authorized_user, :only => :destroy
def create
@micropost = current_user.microposts.build(params[:micropost])
if @micropost.save
flash[:success] = "Micropost created!"
redirect_to root_path
else
@feed_items = []
render ''pages/home''
end
end
def destroy
@micropost.destroy
redirect_back_or root_path
end
private
def authorized_user
@micropost = current_user.microposts.find(params[:id])
rescue
redirect_to root_path
end
end
and finally, the route is..
SampleApp::Appli...
2012 May 01
0
Engine: access to url_helpers otside view/controller
I use Engine.
How to get access to url_helpers, such as <name>_path or _<name>_url, in
a separate class? In application it simple:
Rails.application.routes.url_helpers.<name>_path
But how to get access to url_helpers in Engine? When I use
Rails.application.routes.url_helpers.root_path, then I get ''/'', root of
Application. Other helpers for Engine aren''t not defined. Also
Rails.my_engine.routes.url_helpers.root_path fails.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Rub...
2006 Jun 02
4
Web app developed in WInXP want to run on Linux
Hi All,
I have developed a web application using RoR on Window-XP. Now my server
is on linux and want to get this running on linux machine. I tried
starting the server but it failed to boot in boot.rb at this line:
unless RUBY_PLATFORM =~ /mswin32/
require ''pathname''
root_path = Pathname.new(root_path).cleanpath(true).to_s
end
so I changed(even though the file says not to do any changes) mswin32 to
linux. Again the server didn''t boot and failed at:
./script/../config/boot.rb:18:in `require'': No such file to load --
rubygems (LoadError)
from ....
2010 Sep 03
1
Action Controller Error: undefined local variable or method `current_user'
..._header.html.erb where line #6 raised:
undefined local variable or method `current_user'' for #<#<Class:
0x103371258>:0x10336be70>
Extracted source (around line #6):
3: <nav class="round">
4: <ul>
5: <li><%= link_to "Home", root_path %></li>
6: <% if signed_in? %>
7: <li><%= link_to "Profile", current_user %></li>
8: <% end %>
9: <li><%= link_to "Help", help_path %></li>
Trace of template inclusion: app/views/layouts/application...
2006 Dec 20
16
Edge RSpec on Rails...what did I forget?
Started a new Rails project, and installed RSpec and the Rails plugin
vendor/plugins/rspec (svn://rubyforge.org/var/svn/rspec/trunk/rspec) - 1332
vendor/plugins/rspec_on_rails
(svn://rubyforge.org/var/svn/rspec/trunk/rspec_on_rails/vendor/plugins/rspec_on_rails)
- 1332
Generated the rspec file, created a model...the spec runs fine if I do
ruby spec/models/foo_spec.rb. Running rake though gives
2012 Dec 03
2
Stop User from Changing URL
...loyee
unless signed_in?
store_location
redirect_to signin_path, notice:
"Please sign in to access this page."
end
end
def correct_employee
@employee = Employee.find(params[:id])
redirect_to(root_path) unless current_employee?
(@employee)
end
def admin_employee
redirect_to(root_path) unless
current_employee.admin?
end
end
The pages start out at root. If you try and change the url to say
''employees'' you will get the message...