Questions tagged [url-helper]
29 questions
1
vote
1 answer
rails url_helper placing params where format should be
I'm trying to get Rails generated _path methods to give me
/terms_and_conditions?utm_source=source&utm_campaign=pain#some_link
So I've tried the following in a controller:
utm_params = {"utm_source" => "sauce", "utm_campaign" => "pain"} # from…

user208769
- 2,216
- 1
- 18
- 27
1
vote
2 answers
Inspect a given route to determine if it has a subdomain constraint
I'm building a Rails app that has a merchant subdomain. I have these two routes:
get '/about', controller: :marketing, action: :about, as: :about
get '/about', controller: :merchant, action: :about, constraints: { subdomain: 'merchant' }, as:…

Jody Heavener
- 2,704
- 5
- 41
- 70
1
vote
2 answers
Rails, link_to helper with an URL as a param
I want to generate the next html link:
http://url.com
To reproduce it using the link_to helper I have to write:
<%= link_to "http://url.com", "http://url.com" %>
What doesn't look DRY at all, I was expecting this to…

fguillen
- 36,125
- 23
- 149
- 210
0
votes
1 answer
error with url helper, $this->url(array(), 'home'); generate a link like this http///home
error with url helper, $this->url(array(), 'home'); generate a link like this http///home
Hi,
I've create a custom route in my application.ini file like this:
resources.router.routes.home.route = /home
resources.router.routes.home.defaults.module =…

cthat
- 5
- 1
0
votes
0 answers
How do I populate IUrlHelper from a Background Quartz Task for Email Confirmation?
How do I populate IUrlHelper from a Background Quartz Task for Email Confirmation?
I am using Radzen Studio to create a custom website. It has automatically generated code for an Account Management Controller (AccountController.cs).
I would prefer…

Richard
- 1
0
votes
2 answers
What will be the url help in scope and namespace in rails?
Please tell me what will be the url helpers for the following code?
scope module: 'admin' do
resources :articles, :comments
end
and
scope '/admin' do
resources :articles, :comments
end
and
namespace :admin do
resources :articles,…

Akshit Thakur Ak
- 70
- 10
0
votes
0 answers
ArgumentError when rending view in rake task
I have a rake task which is run on deploy to generate the service_worker.js file. There's a ServiceWorkerController for that purose:
app/controllers/service_worker_controller.rb
class ServiceWorkerController < ActionController::Base
def…

svoop
- 3,318
- 1
- 23
- 41
0
votes
1 answer
Rails nested resources and url helpers - how to shorten
In my routes.rb file I have the following resources:
resources :educations do
resources :semesters do
resources :module_assignments do
resources :module_exams do
resources :module_marks
end
end
end
end
Which…

Marco Roth
- 184
- 4
- 11
0
votes
0 answers
URL helpers can't recognize additional custom dynamic segments in routes
I am using Rails 4.2. In a gem, there is a route defined as
get 'book/:id', to: 'book#show', as: book
I'd like to add an additional dynamic segment in a custom route, so in the routes.rb file in my app, I have
get ':language/book/:id', to:…

djiao
- 453
- 6
- 11
0
votes
2 answers
Overriding URL helpers in Rails
I have a Model (Show) in Rails that is accessed via a subdomain rather than a standard REST URL. In the file app/helpers/url_helper.rb I have the following method:
def show_url(show)
root_url(subdomain: show.subdomain)
end
In controllers, this…

RedBassett
- 3,469
- 3
- 32
- 56
0
votes
0 answers
Can't find parent Url in zend-framework
i have two Zend Framework site in one folder.one is in folder name "short/" other in "short/mobile/".I want the mobile Zend Frameworkversion can access the short folder,
like if i use
/images
Its go to…

Tj Thouhid
- 26
- 3
0
votes
1 answer
How to build named helper using Grape on rails
I'm using grape gem; ref https://github.com/intridea/grape.
Could you show me how to build named path like "twitter_api_v1_statuses_path" ?
My code is as follows
module Twitter
class API < Grape::API
version 'v1', using: :header, vendor:…

Ito Yoshiaki
- 49
- 1
- 3
0
votes
1 answer
How do I make these routes + helpers with resourceful semantics/syntax?
I want a routes like:
get '/posts/new' => 'posts#new'
get '/:username/posts/:id' => 'posts#show'
get '/:username/posts' => 'posts#index'
Accessible via helpers like:
new_post_path #=> new -
post_path(post) #=> show - :username…

Dane O'Connor
- 75,180
- 37
- 119
- 173
0
votes
1 answer
zend framework url helper - how to pass variable before controller?
I have specific problem with Zend Framework (1.12) - url helper.
I have site, divided by languages in this form:
/en/contact
/de/gallery/gal1
etc..
I have changed router to accept first parameter as variable and it's accessible by GET.
How can I set…

Ivan
- 315
- 1
- 3
- 16