FAQ Database Discussion Community


How can I pass data from a meteor controller to a meteor helper?

javascript,meteor,controller,helper
I am trying to pass data from a controller to a helper: My controller: exampleController = RouteController.extend({ data: function() { var a = 13; return { info: a } }, action: function() { this.render('samplePage'); } }); My helper: Sample.helpers({ console.log(info) }); However, I keep getting a 'undefined' error. Any thoughts?...

Rails helper use

html,ruby-on-rails,helper
I'm writing a simple page that will help me view the sync status of my sites custom gallery compared to my Flickr account. I have a simple loop that iterates over a response from the Flickr API: <% for collection in @flickr_hierarchy %> <%= traverse_collection(collection, 0) %> <% end %>...

Magic square code

c++,helper,magic-square
#include <iostream> #include <stdlib.h> #include <time.h> using namespace std; // Functions used in the program. bool uniqueCheck(int arr[][3], int num); bool magicSquare(int arr[][3]); int rTotal(int arr[][3], int row); int cTotal(int arr[][3], int col); int dTotal(int arr[][3], bool left); void display(int arr[][3]); int main() { int arr[3][3]; //makes the array 3x3...

Where does help() find the info in Python?

python,python-2.7,helper,built-in
I discovered the built-in help() recently that prints some information for a module, function, method, class, etc. But where exactly does it find the information it shows? Python docs don't give a single hint about this. >>> import base64 >>> help(base64) Help on module base64: NAME base64 - RFC 3548:...

How to use HTML5 Entities in Rails 4 Helper Tags

ruby-on-rails,html5,tags,helper,entities
I've been trying to use cdata_section, content_tag, escape_once and tag from the tag helper on rails to make the "X" appear from ✖ <%= link_to( ("&#x2716;"), url_options = {:base_rate_id => rates.id}, class: "button tiny" ) % no luck with the different methods. it either displays nil or the raw literal...

Run a helper method on a model class method

ruby-on-rails,ruby,activerecord,module,helper
I created a helper method that I want to run on a model class method and getting a method not found error. lib/model_helper module ModelHelper def method_i_want_to_use puts "I want to use this method" end end model/foo class Foo < ActiveRecord::Base include ModelHelper def self.bar method_i_want_to_use end end This setup...

MeteorJS - access to helpers of the same template

javascript,templates,meteor,helper
I'm working on a first project in meteor and I have trivial problem (I suppose it is easy to do) but I can't find proper way to do it right. This is simplified code in which I want to push some object to helper array. Template.courses.helpers({ doneCourses: [], init: function(){...

Dynamically set form placeholder text with helpers in Rails 4

ruby-on-rails,forms,dynamic,helper,placeholder
I am building an app with different post "templates". Each form for a Post is identical except for the placeholder text. I am trying to figure out how to set the placeholder text dynamically. I've been trying to name all of the template Helpers the same name save for a...

@Html.TextBoxFor not display a specific value

c#,asp.net,asp.net-mvc,razor,helper
I'm developing a website in ASP .Net with Razor. For my forms i'm using Helpers (like @Html.TextBoxFor) and i'd like NOT to show a specific value. It's tricky to explain, so here's some code. My model public class SearchedInstruction { private int _workCenterNumber= -1; public int WorkCenterNumber { get {...

Meteor helper function exception when retrieving the count of all users

javascript,html,dynamic,meteor,helper
On my website I'm trying to display the number of users registered. The problem is that I get a long exception on render. My question is how do you do this dynamically instead of statically? The code works on start up but if I switch pages and come back it...

Third party helper override doesn't work

magento,rewrite,override,magento-1.7,helper
I am writing an extension for Magento 1.7 where I need to override a helper from an third party extension. The name of my extension is Mkpreis_Ebay Name of the third party extension: Ess_M2ePro Helper I want to override: Ess_M2ePro_Helper_Module_Renderer_Description My config.xml <config> <modules> <Mkpreis_Ebay> <version>0.0.1</version> </Mkpreis_Ebay> </modules> <global> <helpers>...

using url helper issue in laravel 5

url,laravel,helper
i'd set up a new route Route::get('/posts/{slug}', [ 'as'=>'postshow', 'uses'=>'[email protected]' ]); i also created a controller: class PostController extends Controller { public function getShow($slug) { return view($slug); } } and i implemented it in the home.blade.phpin which i'm using the url helper : @extends('templates.default') @section('content') @if($posts->count()) @foreach($posts as $post) <article>...

Laravel 5 - Where to define functions and call them in views & controllers

php,helper,laravel-5
I have following function and want to call it from view. Basically i want to put all common functions in one file. I am not sure where to create that file and how to call it inside controller and view. <?php namespace App\Http\Controllers; use App\Http\Controllers\Controller; use DB; class CommonController extends...

Restrict title display to admin users - custom html helper

ruby-on-rails,ruby,helper,helpers
I have a title in my HTML code that displays text via ruby (by the way, there are many examples of these cells): <td title="id:<%= alert.id %>">Hello</td> I will be creating a helper method (for example): def admin? # check if this user is an admin end How do I...

MeteorJS: Callback after template helper was updated

javascript,templates,meteor,callback,helper
I'm new to Meteor.js, so hopefully this is an inability on my part rather than a limitation of the platform because it's pretty amazing otherwise. What I'm trying to achieve is pretty straightforward: run Javascript whenever a template helper gets updated with new data (but not from the db!). A...

Magento Custom Helper not working, why?

magento,layout,module,helper
Trying to debug my Magento custom helper ( using 1.9CE btw) Mag is the name of my custom module. /code/local/Mag/Layout/etc/config.xml <?xml version="1.0"?> <config> <modules> <Mag_Layout> <version>1.0</version> </Mag_Layout> </modules> <global> <page> <layouts> <Mag_HomeLayout translate="label"> <label>Static ( Menu Left )</label> <template>page/static-left.phtml</template> <layout_handle>Static </layout_handle>...

C# No value given for one or more required parameters

c#,sql,syntax,ms-access-2007,helper
Is there anything Wrong in SQL Syntax ? Sql syntax : UPDATE Table1 SET Username='Diana' , Email='[email protected]' , FirstName='' , LastName='' , CrediCardNum='' Where Username='Diana' it Keeps Giving me the Error: No value given for one or more required parameters. I tried restarting visual studio but keeps giving the same...

C++14 using alias for is_same::value

c++,templates,helper,c++14,c++1z
This question uses is_same<uint64_t, decltype(val)>::value. I expected there to be a C++14 using alias: is_same_v similar to the helper types: conditional_t, enable_if_t, and tuple_element_t which I use in my answer. Because the only thing I ever use any of those functions for is to get the type. So the *_t...

i18n in Date::DAYS_INTO_WEEK?

ruby-on-rails,ruby-on-rails-4,hash,helper,rails-i18n
Heelo, Basically what i want to do is I have a helper that that return the day name in week from an index, the base of fuction is the hash Date::DAYS_INTO_WEEK how can localize these names? i already use a svenfuch i18n in pt-BR but i can apply in that...

how can i change css path in html helper? cakephp 3.x

html,path,helper,cakephp-3.0
I want to access admin-css: echo $this->Html->css('adminStyle'); <link rel="stylesheet" href="/css/adminStyle.css" /> But I want this: <link rel="stylesheet" href="/admin/css/adminStyle.css" /> Can I do it that way? My webroot folder: - webroot - admin - css - img - js - css - img - js ...