similar to: Engine: access to url_helpers otside view/controller

Displaying 20 results from an estimated 8000 matches similar to: "Engine: access to url_helpers otside view/controller"

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
2014 Mar 31
0
Rails Engine ActionController::UrlGenerationError on functional tests
Hi, I'm looking for a way to solve an error I get each times I run my functional tests. I have a Rails Engine gem (isolated), I have a JSON action with a route declared. But each times I use the method get in a test I get an ActionController::UrlGenerationError exception. Here an example of code with the problem: # config/routes.rbMyEngine::Engine.routes.draw do resources :cats, only:
2011 Jul 25
3
Rails 3.1 Engines: Full vs. Mountable
Hi all, I was hoping someone could please clarify the differences between a full engine and a mountable one. I have noticed the following: ** Full Engine ** - With a full engine, the parent application inherits the routes from the engine. It is not necessary to specify anything in parent_app/ config/routes.rb. Specifying the gem in Gemfile is enough. The engine routes are specified as: #
2011 Jun 04
1
rails 3 engine under dynamic scope
hello, i have a rails 3 engine scoped dynamically like this: scope "/:locale" do mount MyEngine::Engine => '''', :as => ''my_engine'' end I can''t seem to be able to set my own locale like this: my_engine.page_path(page, :locale => ''de'') the path is generated like this: /en/page/12345?locale=de instead of
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@public.gmane.org To
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
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''t seen any resolution on the mailing list yet.
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
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]
2006 Jan 12
2
Engines issue: rake test_plugins failing when it shouldn''t
I create a simple engine with a simple controller: class FredController < ApplicationController def hello render :text => ''Hello, world!'' end end and I create a simple functional test within the engine: class FredControllerTest < Test::Unit::TestCase ... def test_hello get :hello assert_response :success end
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
2006 Jan 17
3
file_column :root_path question.
I''m developing on Windows and deploying 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:
2009 Apr 29
1
Cucumber/Webrat/Selenium + SSL?
Has anybody had any luck getting Cucumber, Webrat and Selenium to play nicely together for SSL sites? My test environment: - nginx front-end accepting SSL requests, proxying them to mongrel back-end - mongrel back-end accepting normal HTTP requests - application routes configured with ":protocol => ''https''" so that URLs generated with "_url"
2013 Apr 06
3
btrfs-progs: re-add send-test
From: Mark Fasheh <mfasheh@suse.de> btrfs-progs: re-add send-test send-test.c links against libbtrfs and uses the send functionality provided to decode and print a send stream to the console. 66819df "btrfs-progs: add send-test" contained this file when submitted, but somehow got lost on commit. [sandeen@redhat.com: Resurrect lost send-test.c from original commit]
2011 Nov 12
4
No route matches [GET] "/microposts/304"
Hi all, I''m learning Rails by Example (chapter 11), by Michael Hartl ( http://ruby.railstutorial.org/chapters/user-microposts#top) but I got no route matches when I try to delete one micropost. the _micropost html is... <tr> <td class="micropost"> <span class="content"><%= micropost.content %></span> <span
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
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},
2012 Jul 18
0
Rails 3.1 Optional Routes
Hi all, I am using Rails 3.1 and Ruby 1.9.2 In my application i am using optional routes like below match ''Gallery(/:gallery_id(/:image_id))(/page/:g_page)'' => "wps/ gallery#show_gallery_page",:as => :gallery_page in console i am trying to call the routes like below include Rails.application.routes.url_helpers => Object 1.9.3dev :002 > gallery_page_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 because you are subscribed to
2007 Dec 29
5
./script/story command
Below I''ve pasted a ./script/story command I''ve been using for about a week. It has three modes of operation: 1. ./script/story with no arguments will run all *.story files in the story path 2. ./script/story with a path or glob will run the specified stories 3. If input is passed in via STDIN, it runs that text as a story. This opens up story running via a simple interface