view-helpers Questions
13
Solved
Basically, I have a lot of code that looks like this:
link_to t('.profile'), business_path(@business), class: '#{'active' if current_page? business_path(@business)}'
which isn't very DRY.
I was...
Adolescence asked 5/9, 2013 at 16:59
3
Solved
I want to call a javascript function that will be conditional upon a user's response to the confirm box.
For example, I have the following anchor:
<%= link_to 'Sign Out', destroy_session_path,...
Pilotage asked 5/11, 2012 at 0:30
4
Solved
I've a view helper method which generates a url by looking at request.domain and request.port_string.
module ApplicationHelper
def root_with_subdomain(subdomain)
subdomain += "." unless subdo...
Concelebrate asked 27/10, 2010 at 3:59
6
Solved
I have some Ruby methods certain (or all) controllers need. I tried putting them in /app/helpers/application_helper.rb. I've used that for methods to be used in views. But controllers don't see tho...
Neogaea asked 28/11, 2012 at 19:48
3
Solved
In my App_code, I have a helper function called FormatTelephone(string number) in Formatter.cshtml. I tried to access it in a partial view by @Formatter.FormatTelephone(number). When I test it, it ...
Shabby asked 20/10, 2011 at 16:57
4
Solved
During refactoring it would be quite handy just to copy part of HAML template and paste it to helper's code. Currently in such cases 1) I have to rewrite that part of view from scratch 2) I have to...
Maser asked 9/3, 2011 at 11:58
1
Solved
There are several examples for writing a custom ViewHelper and different ways to do things. I have seen examples with render() and with renderStatic (for example in Developing a Custom ViewHelper)....
Mezzotint asked 5/2, 2019 at 9:25
5
I'm new to Zend Framework2 and I´m asking for advice for the following situation:
I´m using the ZF2 Breadcrumbs Helper to create breadcrums on my project and this code:
//breadcrumbs.phtml
ec...
Allonge asked 15/11, 2012 at 16:56
2
Solved
Problem: I wrote a conditional VH (extending AbstractConditionViewHelper) and it works as usually, anyway I realized that in non-cached version it is evaluated only once. Initialy I thought that's ...
Lyman asked 11/1, 2016 at 18:59
3
Solved
I want viewhelper that can be helpful to assign variable in fluid, I dont want variable to be passed from controller.
Cantharides asked 12/6, 2015 at 13:36
3
Solved
<%= f.check_box :openid_enabled %>
<%= f.label :openid_enabled, 'OpenID' %>
Above code generate this HTML
<input type="hidden" value="0" name="application[openid_enabled]">
<...
Posse asked 20/8, 2012 at 11:1
2
Solved
Boolean attributes, as defined in the html 5 draft specification:
http://dev.w3.org/html5/spec/Overview.html#boolean-attributes
The presence of a boolean attribute on
an element represents the...
Ageless asked 10/3, 2011 at 0:37
1
I want to build a link in my view that refers to the same page like that one where its placed on. And I want to be able to give a parameter with.
For example I want to change languages. I have a r...
Bellybutton asked 11/2, 2016 at 15:17
4
I want my customer section to be https, e.g. registration, login, personal details, order details, etc. I have set up my route to include the https scheme (I can access the customer section via htt...
Cracker asked 29/1, 2016 at 11:5
1
Solved
I have a web app in which I also have quite a complex type of blog. For this blog I use both RedCarpet as markup language in addition to a homemade markup language, that is very useful.
In my home...
Kaliski asked 23/8, 2015 at 9:1
1
Solved
i use this condition in my fluid template:
<f:if condition="{settings.image.className} == 'lightbox'">
<f:then>
....do something
</f:then>
<f:else>
<f:if...
Surtax asked 14/7, 2015 at 12:31
2
Solved
I have
the default created_at date keep printing out as an MySQL format : 2015-06-12 09:01:26. I wanted to print it as my own way like 12/2/2017, and other formats in the future.
I created
a file ...
Koral asked 12/6, 2015 at 13:21
5
Solved
I have found a few articles addressing the issue of helpers within an engine not being accessible to the consuming (parent) application. To make sure we are all on the same page, let's say we have ...
Vaishnava asked 10/1, 2012 at 1:58
3
Solved
I am attempting to open a .chm file(A windows help file) at a specific page/topic by using a system call in C++.
I can successfully open the .chm file to the start page through the following code,...
Spahi asked 18/6, 2012 at 4:32
4
Solved
I would like to access the TempData in my helper for a flash message (like in ruby)
I get a runtime error of
The name 'TempData' does not exist in the current context
my Flash.cshtml is as fol...
Visigoth asked 6/1, 2012 at 18:35
1
Solved
I'm trying to access the service locator in a view helper so i can access to my config. I'm using this view helper for a recursive function so i don't know where to declare the service locator.
na...
Ellison asked 8/5, 2014 at 1:58
2
Solved
I read about collection_check_boxes but I don't understand how can I set the checked values.
I have the following model:
class Objective < ActiveRecord::Base
has_many :indicators
has_many :o...
Calves asked 31/7, 2013 at 23:45
3
I am trying to enable view compilation to have my ASP.NET MVC3 web site load faster. My web site is hosted on AppHarbor.
However, my views make use of MVC3 view helpers, defined in the App_Code fo...
Radioman asked 29/10, 2012 at 11:33
3
Solved
I'm using Rabl to generate XML output in a rake task:
xml = Rabl.render @listings, 'feeds/listings', :format => :xml
# do stuff with xml
However, I need to use multiple helper methods in the ...
Mechling asked 6/8, 2013 at 22:21
1
Solved
I've got a Rails 3 helper which needs to generate elements which might have HTML entities in the attribute values. For example:
content_tag(:input, nil, :type => 'button', :value => 'Redo &a...
Hylotheism asked 25/7, 2013 at 23:2
1 Next >
© 2022 - 2024 — McMap. All rights reserved.