helper

Why does my recursive method from helper not return every value?

非 Y 不嫁゛ 提交于 2019-12-30 18:39:51
问题 I want to display a tree of categories managed with the gem ancestry. I would like to use a helper which will recursively go through the tree and return the categories one by one, for the moment without html tags or content. module CategoriesHelper def display_tree(category) if category.has_children? category.children.each do |sub_category| display_tree(sub_category) puts(sub_category.name) # to check if it goes here end end category.name end end The category argument is one of the root

Magento Admin Helper_Data not found

徘徊边缘 提交于 2019-12-25 05:24:19
问题 I've installed an extension by BrandAmmo named ProNav. I went to clear the cache and it gave me this error in the admin, Fatal error: Class **Brandammo_Pronav_Helper_Data' not found in /home/content/r/e/d/redr1225/html/app/Mage.php on line 516** Any idea what I need to do? 回答1: Make sure this file exists: /home/content/r/e/d/redr1225/html/app/code/local/BrandAmmo/Pronav/Helper/Data.php And that it creates this class: class BrandAmmo_Pronav_Helper_Data extends Mage_Core_Helper_Abstract { } And

how to call multiple controller action from within any action in ZF?

最后都变了- 提交于 2019-12-24 23:08:44
问题 I have a controller action and I want it to be executed after any action. I have written an action helper with this method: public function postDispatch(){ $actionstack = Zend_Controller_Action_HelperBroker::getStaticHelper('actionStack'); $actionstack->direct('myaction', 'mycontroller'); } But it seems that it stuck in a loop, what is wrong with my code? 回答1: You could create a Plugin, for example: class Plugin_Sidebar extends Zend_Controller_Plugin_Abstract { public function postDispatch

How can I make a draggable item's style match the target using the custom helper or any other method?

最后都变了- 提交于 2019-12-24 21:05:45
问题 Using the example here as a starting point, I set out to customize my draggable and sortable data. In the linked example, we have simple text in the draggable. I replaced it with a select tag. When dragging the select element into the sortable, I would like to use only the value of the selected option when moving it to the sortable list. To this end, I use the custom helper, but unfortunately, as soon as I drop it, it turns into a select element again. $("#draggable").draggable({

html is being escaped in link_to

人走茶凉 提交于 2019-12-24 08:23:10
问题 I'm trying to implement a link, when clicked marks you as present for a meeting. This link is a method in a helper: def link_to_remote_registration(event_id) down_image = "down_blanco.png" up_image = "up_blanco.png" unless registration.nil? if registration.present == 1 up_image = "up_filled.png" elsif registration.present == 0 down_image = "down_filled.png" end end link_to_remote_registration = String.new loading_and_complete = "Element.show('indicator_event_"+event_id.to_s+"'); Element.hide(

build helper plugin not parsing project version

ε祈祈猫儿з 提交于 2019-12-24 08:13:16
问题 I have a project where I have a need to break the version number down and access it's component pieces when building a manifest file. After doing some searching around I found the build-helper-maven-plugin and figured my problem was solved. I added the plugin to the master POM, it's shown below. <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId> <version>1.7</version> <executions> <execution> <phase>validate</phase> <id>parse-version</id> <goals>

How can i increase the font size of codeigniter captcha helper

巧了我就是萌 提交于 2019-12-23 10:55:34
问题 I am using the codeigniter * capctha * helper. The thing is I can not increase the font size of letters. I tried to do it by if ($use_font == FALSE) { $font_size = 6; $x = rand(0, $img_width/($length/2)); $y = 0; } else { $font_size = 20; $x = rand(0, $img_width/($length/1.5)); $y = $font_size+2; } but nothing happens, how can change the font size, please help. Thanks in advance. 回答1: You are changing the correct parameter, whether in the core file or the application/helpers file. Double

Like Box - Showing “check in's” rather than recent posts?

断了今生、忘了曾经 提交于 2019-12-22 12:43:27
问题 I just added a Facebook Like Box, per the instructions on the developers page here:https://developers.facebook.com/docs/reference/plugins/like-box/ The page says it should show recent posts from the page. However, on my site, it only shows the "friendly activity" feed on the page which seems to be ONLY the people that have checked in to the restaurant. Is it because its a "place" that its doing this? And I may need to make it a business rather than location to adjust the feed? Is there a

Django Crispy Forms - Add Button via Helper

落爺英雄遲暮 提交于 2019-12-22 10:04:06
问题 I studied the Crispy-Forms documentation and I tried to put an extra button into one of my forms. With self.helper.add_input(Button('back', "Back", css_class='btn')) I can add a nice button. But the Button() wont take an onclick or on_click-attribute. So how can I add logic to this button? Adding an onclick event with JQuery isnt a very nice solution... Thanks! Ron 回答1: This is not included by default (afaik..). If you just need this once, is possible to use crispy-forms HTML Layout Object

Ruby on Rails: Initializing instance variables with helpers in view

我们两清 提交于 2019-12-22 08:21:24
问题 I'm running into some type of a scope issue that's preventing instance variables from being properly initialized by helpers called from the view. #sample_controller.rb class SampleController < ApplicationController def test end end #application_controller.rb helper_method :display def display if not defined? @display return @display = "a" else return @display += "a" end end #test.html.erb <%= display %> <%= display %> <%= @display %> <%= @display.reverse %> When sample/test is displayed, it