search for: _url

Displaying 20 results from an estimated 34 matches for "_url".

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 the...
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...
2006 Jun 04
0
A little confused about routes....
I''m currently playing around with various URL patterns and I''m a little confused about how routes and the _url helpers work. I''ve read through the AWDWR book (1st edition and current 2nd edition beta book) and I''m still not clear on what''s happening. I''ve been working with variations of the following route: map.competition ''competitions/:short_name/:contro...
2006 Aug 08
1
Named routes and url generation?
...roller just work fine BUT... Now, on the same page of my application, I want to generate links for all the possible levels my controller can act... I.e. if I''m in context3 I want to provide links to context1, context2 and context3 urls So I''ve done something like label_context1_url params label_context2_url params label_context3_url params This code just returns n times the most complete url. i.e. if I''m in context3 the code above will generate 3 identical urls :context1/:context2/:context3/label Can someone explain to me this beahviour? my opinion is that if th...
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-/JYPxA39Uh5TLH3MbocF...
2007 Aug 27
2
issue with edge rails and urls
I just switched our project over to Edge Rails, and I''m running into this problem with all of my helper methods that call _url methods: NoMethodError in ''ApplicationHelper home_link should generate a valid home link when User.current and Profile.current is not set'' You have a nil object when you didn''t expect it! You might have expected an instance of Array. The error occurred while evaluating...
2009 Apr 29
1
Cucumber/Webrat/Selenium + SSL?
...ther 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" 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 "feat...
2006 Jul 08
0
Different URL generation in regular and named routes.
...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/.
2006 Aug 02
0
Simply RESTful deletion
Evening all! I''m playing around with the new Simply RESTful plugin, and I''ve got a question about the *_url methods. >From what I understand, given a Page model, there are three _url methods provided: - page_url - new_page_url - edit_page_url I''m a bit disturbed that there are only three, but that aside... To delete a resource, I would say: link_to(''Delete'', page_url(:...
2006 Jan 28
2
Creating html e-mails with embedded graphics
I am new to RoR and I have a new project for which I''d like to use it. I have created a short list of the important functionality I need and it seems like everything is covered except one thing: I need to generate and send mime-encoded e-mails with a plain text part, an HTML part with embedded graphics, and possibly an attachment. In the old days (up until last week) I would have
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 p...
2006 May 09
1
name_url in tests
Hi there, I posted earlier asking about testing named routes in functional tests, but got no response, so I''m making my question less specific. It seems from the docs that it''s possible to to test named routes in cases such as: asserts_redirect_to name_url(:param => "whatever") but I haven''t seen any mention of it being used with any other tests and I keep getting an error when I try and use it in assert_recognizes (see below). Is there anything in particular I have to do to get the _url functionality imported into my tests? I...
2011 Jan 17
3
Getting Hostname in mailer view
Hi everyone, I need to build a url in my mails view. For restfull resources I can use routing and "..._url" target. But for custom url I don''t know how I get the hostname of my web app. I didn''t know how I can get get the value specified on config.action_mailer.default_url_options = {:host => "here_my_host_i_want_get" } Thanks for reply Vincent -- Posted via http...
2007 Dec 10
11
map.namespace, rake routes yields no POST URLs
...space :admin do |admin| admin.resources :cupcakes end rake routes cupcakes GET /cupcakes formatted_cupcakes GET /cupcakes.:format POST /cupcakes POST /cupcakes.:format That said, what the heck goes here: form_for(:cupcake, @cupcake, xxx_url) # ??? Calling create_admin_cupcake_url yields... undefined local variable or method ''create_admin_cupcake_url'' Additionally, calling form_for(@cupcake) yields... undefined method ''cupcake_path'' Finally, I''ve also tried... form_for(:cupcake, @cupca...
2008 Dec 03
5
How to test a plugin
Guys, I''ve created a plugin, i wanna put my automated test there. However, I got bad file descriptor error when i run the test like normal unit test file: "ruby plugins/acts_as_fox/test/acts_as_fox_test.rb" How to test a plugin? Also, is it right to say that I should only put my unit tests (but not functional test for example) for the plugin in the plugin test folder?
2007 Jan 31
2
SystemStackError: stack level too deep
I''m testing the http module in console. BUt I got the following error. Anyone knows why? >> Net::HTTP.get_print ''www.google.com'', ''index.html'' SystemStackError: stack level too deep from C:/InstantRails/ruby/lib/ruby/1.8/net/http.rb:451:in `newobj'' from C:/InstantRails/ruby/lib/ruby/1.8/net/http.rb:451:in
2007 Feb 22
0
3 commits - libswfdec/swfdec_js.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_script.c
...scale", "_yscale", "_currentframe", - "_totalframes", "_alpha", "_visible", "_width", "_height", - "_rotation", "_target", "_framesloaded", "_name", "_droptarget", - "_url", "_highquality", "_focusrect", "_soundbuftime", "_quality", - "_xmouse", "_ymouse" -}; - -static JSBool +static const char * swfdec_eval_jsval (JSContext *cx, JSObject *obj, jsval *val) { if (JSVAL_IS_STRING (*val)) { cons...
2006 Oct 21
0
@helpers no longer required?
After updating to the latest version of Markaby, I''ve noticed that @helpers doesn''t seem to be necessary when accessing params, flash, etc. and named routes (*_url) in Rails. Is and will @helpers no longer be necessary? (And if so, let me be the first to say YAY!) Thanks, Joe __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
2006 May 17
0
class filter: cannot call protected controller methods
Greetins all, I''m rewriting a filter from the method form to a class filter.(see below) Problem: some controller - redirect_to - and route - *_url - methods are protected (redirect_to, f.ex.), and cannot be called. Is this intended? Is there a solution workaround? TIA Alain BEFORE: ----------- before_filter :login_required, :except => [:welcome,:login] def login_required unless current_user session[:jumpt...
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'...