Displaying 20 results from an estimated 37 matches for "url_helper".
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...
2013 Jul 18
0
url_helpers in /lib
Hi, I''m trying to generate some static feeds using a script in /lib that I
will later call from a sidekiq worker and I need to access the URL helpers
from my library, how can I do it?
What I tried so far is including Rails.application.routes.url_helpers in my
class but it doesn''t seem to work. I''ve also tried to follow this blog
post http://hawkins.io/2012/03/generating_urls_whenever_and_wherever_you_want/
but still no success.
Does someone know how to use url helpers inside a lib?
ngw
--
You received this message becau...
2013 Mar 27
0
Rspec + include Rails.application.routes.url_helpers
Hello there,
I''m having some issues trying to test a custom helper. And I been trying
to figure this out without luck. Please, see attachs for more
information. Thanks in advance.
Attachments:
http://www.ruby-forum.com/attachment/8268/errors.txt
http://www.ruby-forum.com/attachment/8269/spec_helper.rb
http://www.ruby-forum.com/attachment/8270/products_helper.rb
2007 Aug 30
1
alias_method_chain stack level too deep in Rake test only
...;/li>
11: </ol>
lib/action_controller/ssl_support.rb:36:in `url_ssl?''
lib/action_controller/ssl_support.rb:19:in
`url_for_without_ssl_support''
lib/action_controller/ssl_support.rb:28:in `url_for''
vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb:
70:in `send''
vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb:
70:in `url_for_without_ssl_support''
lib/action_controller/ssl_support.rb:28:in `url_for''
vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb:
136:in `link_to''
I...
2007 Feb 21
6
Problem with url_for and https - overrides all options
I have a piece of code like this in one of my views:
<%=link_to "link here", :action=>''my_action'', :id=>1 %>
It works fine on my local development machine, running Webrick over http
and it works fine on my testing server which is running single mongrel
instance behind Apache 1.3 as a proxy. On both the outcome link is this:
<a
2006 Mar 12
2
Strange error: undefined method `rewrite''
...`----
,----
| /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:1501:in `method_missing''
| /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:448:in `url_for''
| /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/helpers/url_helper.rb:18:in `url_for''
| /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/helpers/url_helper.rb:49:in `link_to''
| #{RAILS_ROOT}/app/views/urls/show.rhtml:7
`----
I looked at the source and found out that the error originates from the
following code:
,----
| def ur...
2006 Aug 04
5
image_tag + ActionMailer
Hi,
Any idea why image_tag doesn''t work within an email template? I''m trying to
generate the URL for an image and I''m getting the following error.
undefined method `request'' for #<Mailer:0x6a719e0>
I''ve been able to use link_to but no luck with image_tag.
I''ve seen a similar post to this in the list but no one has posted a
response.
2016 Jul 17
0
firewalld cloud-init dhcp error
...internet.
And before setig firewalld, there's no problem on reboot.
/var/log/cloud-init.log shows following
Jul 17 14:18:46 biz105 cloud-init: ci-info:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Route info
failed!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Jul 17 14:21:01 biz105 cloud-init: 2016-07-17 14:21:01,476 -
url_helper.py[WARNING]: Calling '
http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [3/120s]:
unexp
ected error ['NoneType' object has no attribute 'status_code']
Jul 17 14:21:04 biz105 cloud-init: 2016-07-17 14:21:04,482 -
url_helper.py[WARNING]: Calling '
http://169...
2006 Feb 27
0
Mapping '':action/:id/:controller/'' doesn''t work
...local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/
action_controller/url_rewriter.rb:11:in `rewrite''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/
action_controller/base.rb:448:in `url_for''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/
helpers/url_helper.rb:18:in `send''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/
helpers/url_helper.rb:18:in `url_for''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/
helpers/url_helper.rb:49:in `link_to''
#{RAILS_ROOT}/app/views/inputs/start.rht...
2007 Apr 07
1
Undefined Method 'rewrite' when calling link_to
...r:
undefined method `rewrite'' for
[]:ActionController::Routing::PathSegment::Result
The trace ends with
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/base.rb:522:in
`url_for''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/helpers/url_helper.rb:27:in
`send''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/helpers/url_helper.rb:27:in
`url_for''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/helpers/url_helper.rb:75:in
`link_to''
url.rewrite is defined in a module named &q...
2007 Sep 20
1
undefined method `request' for "products":String ?
...<%=
link_to_orderable("Created", "created_at") %></th>
13: <th width="70" class="orderable"><%=
link_to_orderable("Updated", "updated_at") %></th>
---
vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb:70:in
`send''
vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb:70:in
`url_for''
vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb:136:in
`link_to''
app/helpers/admin/base_helper.rb:19:in `link_to_orderable''
app/views/admin/categories/inde...
2006 May 26
8
calling render_to_string outside of controller
How can I call render_to_string outside of a controller. I''m stuck on
this. I''ve nearly got my plugin finished but I can''t seem to get this
to work. The method is in ActionController::Base but it is protected.
--
Posted via http://www.ruby-forum.com/.
2010 Sep 11
0
Rails 3 helper method not called
While I was trying to port one application from Rail 2 to Rails 3 I''ve
noticed that helper methods used for rewriting URL paths are not
called. Methods are defined in app/helpers/url_helper.rb:
module UrlHelper
def story_pah(story)
"/story/#{story.title}"
end
end
This method, when called inside of view instead of:
story/1
creates path
story/story_title.
I order to double check this I''ve create two new applications. One in
Rails 2 and the other in Rails...
2010 Dec 03
2
Rails 3 console ...
In the console
to check my paths, I used to write ( In Rails 2)
include ActionController::UrlWriter
then I could test my paths : new_project_path , ....
but now in Rails 3
include ActionController::UrlWriter
gives an error
NameError: uninitialized constant ActionController::UrlWriter
sure something changed, any other additional include needed ?
thanks fyh
--
You received this message
2005 Mar 02
2
form action in mail (actionmailer)
...<%= start_form_tag :action => "http://myhostname/mycontroller/myaction" %> or
<%= start_form_tag :action => "myaction", :action_prefix => "http://myhostname/mycontroller" %>
but met same errors
/gems/actionpack-1.3.1/lib/action_view/helpers/url_helper.rb:11:in `send''
/gems/actionpack-1.3.1/lib/action_view/helpers/url_helper.rb:11:in `url_for''
/gems/actionpack-1.3.1/lib/action_view/helpers/tag_helper.rb:35:in `start_form_tag''
(erb):5:in `render_template''
2. so I changed my appoach to plain html li...
2006 Jun 04
3
Absolutize URLs in a string
I wonder - do we have some helper/processor/gem to automatically
convert all URLs in a passed string to their canonical equivalent -
i.e. with the protocol, host and such prepended based on the Rails
environment. Super-duper infty for RSS feeds (I hate their
requirement for canonical URLs everywhere).
--
Julian ''Julik'' Tarkhanov
please send all personal mail to
me at
2008 Jul 23
0
Link_to_remote object missing
.../usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/url_rewriter.rb:88:in `rewrite''
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/base.rb:621:in `url_for''
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_view/
helpers/url_helper.rb:76:in `send''
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_view/
helpers/url_helper.rb:76:in `url_for''
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_view/
helpers/prototype_helper.rb:461:in `remote_function''
/usr/lib64/ruby/gems/1.8/...
2016 Jul 16
1
Problem with cloud-init on re-boot
When I re-boot my CentOS 7 machine I get lots of error/warning messages
like the following:
------------------------------
Jan 1 14:39:04 alfred cloud-init: 2016-01-01 14:39:04,351 -
url_helper.py[WARNING]:
Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed
[2/120s]:
unexpected error ['NoneType' object has no attribute 'status_code']
------------------------------
Re-booting with the current kernel, 3.10.0-327.22.2.el7.x86_64,
sometimes...
2007 Oct 01
0
View Spec - Misbehaving
...ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/url_rewriter.rb:69:in
> `rewrite''
> /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:522:in
> `url_for''
> /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/helpers/url_helper.rb:27:in
> `send''
> /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/helpers/url_helper.rb:27:in
> `url_for''
> (eval):19:in `unsafe_customer_path''
> #{RAILS_ROOT}/lib/url_helper_advice.rb:21:in `customer_path''
> #{RA...
2010 Jul 27
13
3.0.0rc ActionController::RoutingError No route matches
Have been developing on 3.0.0beta4 and just updated to 3.0.0.rc.
When I try to link_to() a User object that previously had worked, I
get the following:
ActionView::Template::Error (No route matches
{:action=>"destroy", :controller=>"games", :id=>#<User ..... >
Yet I have in my routes.rb file has resources :users and my "rake
routes" shows: