Displaying 20 results from an estimated 29 matches for "_path".
Did you mean:
path
2007 Mar 14
11
path vs. url
When using named RESTful routes, when should one use the
generated ..._path helpers, and when the ..._url helpers? Say I did
this in routes.rb:
map.resources :users
Where should I use users_path, new_user_path, etc., and where should I
use users_url, new_user_url...?
Thanks!
Steve
--~--~---------~--~----~------------~-------~--~----~
You received this message beca...
2008 May 01
20
link_to meta programming question
I am trying to create a dynamic menu using the following construct:
<%- menu_list = [ ''first'', ''second'', ''third''] -%>
<ul>
<%- menu_list.each do |m| -%>
<%= link_to "List All #{m.titlecase.pluralize} <m>_path %>
<%- end -%>
</ul>
What I cannot determine is what I have to do to replace <m> so that the
link_to has a target. I have tried string substitution ("#{m}"_path)
but that gives a compile error:
_erbout.concat(( link_to "List All #{m.titlecase.pluralize}&quo...
2008 Mar 31
10
Problems with *_path() and *_url() helpers when using Publisher
Hello,
I am running into issues using *_path() and *_url() helpers the
Facebooker Publisher framework. I encounter the following error when
using these helpers while *inside of a partial*:
undefined method `default_url_options'' for ActionView::Base:Class
I''ve seen a few other people speak about this issue, yet I haven'...
2007 Nov 30
2
Nested resources and _path methods
Hi guys,
I was thinking aboiut this for a while:
If I have nested resource routes, for example /building/1/floor/2/
room/
3 (building has_many floors and so on), I have to call the room_path
method like this:
room_path @room.floor.building, @room.floor, @room
IsnĀ“t there a better way to handle nested routes with foreign keys, or
can I have this method overwritten somewhere?
Greets
Jonas
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are s...
2009 Jun 02
1
[PATCH] ocfs2: Adjust rightmost path in ocfs2_add_branch.
...com>
---
fs/ocfs2/alloc.c | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 94 insertions(+), 4 deletions(-)
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index 678a067..7ce5e2f 100644
--- a/fs/ocfs2/alloc.c
+++ b/fs/ocfs2/alloc.c
@@ -475,6 +475,8 @@ struct ocfs2_path {
#define path_leaf_el(_path) ((_path)->p_node[(_path)->p_tree_depth].el)
#define path_num_items(_path) ((_path)->p_tree_depth + 1)
+static int ocfs2_find_path(struct inode *inode, struct ocfs2_path *path,
+ u32 cpos);
/*
* Reset the actual path elements so that we can re-use t...
2006 Sep 05
1
Named routes and current_page? incompatibility
Hi,
I have some named routes defined e.g. map.public and wish to use
link_to_unless_current() to disable link.
However, as I''ve seen from forum discussions and the API doc, the issue
lies with the fact that the named_route_url() method generated by a
named route does not default to only_path = true like url_for.
Therefore, the current_page? within link_to_unless_current() will not
match.
Apparently there is a recent alternative so that _path on all named
routes is also provided with _url. I tried this (e.g. using
public_path(...)) and got an undefined_method error. Does anyone kn...
2011 Mar 26
2
Rails 3 + SSL
...com). I want to have some pages use
ssl, and some not. It appears the require_ssl approach is pre-Rails3
and there are other alternatives. Most of the posts I read talk about
using a diff domain for ssl (secure.mysite.com). Doing that means I
have to flip domains and seems to get in the way of *_path niceties of
routes in rails3.
I realize I''m probably making this harder than it needs to be, but
it''s my first ssl implementation.
thanks for the replies in advance
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" gro...
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...
2008 Feb 29
3
How to DRY REST admin path in URLs?
Hi everyone...
For almost all of my objects I put a series of classic REST admin links
in views. For example, for a ''user'', I have
<%= link_to "Show", user_path(user) %>
<%= link_to "Edit", edit_user_path(user) %>
<%= link_to "Destroy", user_path(user), :confirm => "Are you sure",
:method => :delete %>
I am tired of writing those links down over and over and look for a way
to DRY it a little bit.
I am thi...
2009 Jun 12
2
[PATCH 0/2] ocfs2: Adjust rightmost path in ocfs2_add_branch.v2
Hi Mark/Joel,
This is the v2 of bug fix for ocfs2_add_branch.
Modification from V1 to V2:
1. Create a patch which return EROFS instead of BUG in ocfs2_insert_at_leaf.
2. Use ocfs2_adjust_rightmost_records to change the root and extent
blocks in the rightmost path.
Regards,
Tao
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 helper...
2009 Apr 29
1
Cucumber/Webrat/Selenium + SSL?
...them to mongrel
back-end
- mongrel back-end accepting normal HTTP requests
- application routes configured with ":protocol => ''https''" so that
URLs generated with "_url" helpers will be SSL ones
- application links basically all generated using "_path" helpers and
not "_url" helpers, so the site can be tested by connected directly to
the mongrel instance rather than having to go through the nginx proxy
- Cucumber paths (in "features/support/paths.rb" defined using "_path"
helpers, not "_url" he...
2012 May 11
14
What is the point of using :format in routes?
...;/fields/remove/:id'' => ''fields#remove'', as: :remove_field
routes.js.coffee.erb:
<% h = Rails.application.routes.url_helpers
{ fields: false, remove_field: true }.each do |named_route, expect_id| %>
<% if expect_id %>
window.<%= named_route %>_path = (id, format=''.json'')-> "<%= h.send
:"#{named_route}_path", ''999'' %>#{format}".replace(''999'', id)
<% else %>
window.<%= named_route %>_path = ''<%= h.send :"#{named_route}_path"...
2006 Jul 08
0
Different URL generation in regular and named routes.
Obviously I am missed something, but why the way a path is generating
using named routes is a little bit different from using regular url_for?
1. Parameters from current request did not affect named routes, the way
it is in the url_for.
2. only_path=>false by default in named routes. It is true by default
whe using *_path instead of *_url, by why not to set it true by default
in *_url and get rid of two practically identical methods?
--
Posted via http://www.ruby-forum.com/.
2009 Mar 02
0
Xapian, PHP bindings and
...it work !!!
Here is my < simple > code :
<?php
require_once( '../global.info.php' );
require_once( 'xapian.class.php' );
require_once( 'xapianencode.func.php' );
// Open the database for searching.
try {
$database = new XapianDatabase(
$_PATH.'/_inc/cache/xapian/pa' );
// Start an enquire session.
$enquire = new XapianEnquire($database);
// Combine the rest of the command line arguments with
spaces between
// them, so that simple queries don...
2007 May 13
0
Problems with RMagick libraries
...#39;RMagick'' to the models, but it still not working.
I checked in my directory
/usr/lib/ruby/gems/1.8/gems/rmagick-1.15.4/lib/RMagick.so and it exists.
I can''t change the ld.so.conf file because the admin server don''t want
to give me access and I can''t set LD_.._PATH= /usr/lib for the same
reason.
The solution have to be something in my rails directory, like put the
libraries RMagick.so and RMagick in, for example, rails/plugin and call
it from environment.rb... but I no have idea about how to do.
Some ideas about this problem? thanks!
--
Posted via http://w...
2011 Oct 05
0
Optional Dynamic Prepended Route via scope
...we want to prepend the
organization to each route within that scope. Following the Rails
guides, I attempted to use:
default_url_options()
{ :organization => current_organization.name }
end
Which generated URLs in the way desired, e.g. /Organization1/system/
However, the URLs generated (via _path() calls, e.g. dashboard_path())
include the extra paramter ?organization=Organization1 which is not
the behavior desired for this application.
My question then is - is it possible to have the organization set and
included for only those routes that declare a scope of /:organization.
--
You recei...
2007 Dec 12
0
default_url_options
Hi,
i recently added a def default_url_options to application.rb (used by
url_for , *_path etc). My method references request (eg
request.domain) . But when I spec a controller, its dies in
default_url_options with nil.domain, Is there a way for it to see
"request"?
I prefer to not have to stub it on every example.
linoj
2009 Mar 27
42
[PATCH 00/42] ocfs2: Add reflink file support. V1
Hi all,
So I have finally finished the v1 of reflink for ocfs2. It has some
bugs that I am still investigating, but the schema is almost there. So
I'd like to send it out first for review. And Tristan and I will
continue to work on the stability of the code.
The general information for reflink, please see
http://oss.oracle.com/osswiki/OCFS2/DesignDocs/Reflink.
For the design doc, please
2009 Apr 03
42
[PATCH 00/42] ocfs2: Add reflink file support. V2
Hi all,
Change from v1 to v2: bug fix and metadata/credits reservation
improvement.
The general information for reflink, please see
http://oss.oracle.com/osswiki/OCFS2/DesignDocs/Reflink.
For the design doc, please see
http://oss.oracle.com/osswiki/OCFS2/DesignDocs/RefcountTrees
http://oss.oracle.com/osswiki/OCFS2/DesignDocs/ReflinkOperation