Posts

ruby - Rails strong parameters with objects array -

when using rails 4.0 strong parameters, how permit json this? { "user": { "first_name":"jello" }, "users_to_employer":[ { "start_date":"2013-09-03t16:45:27+02:00", "end_date":"2013-09-10t16:45:27+02:00", "employer":{"company_name":"telenor"} }, { "start_date":"2013-09-17t16:45:27+02:00", "end_date":null, "employer":{"company_name":"erixon"} } ] } i tried following: params.require(:users_to_employers => []).permit( :start_date, :end_date => nil, :employer => [ :company_name ...

css - Unable to change Menu title in jQuery (MeanMenu) -

i'm using meanmenu jquery responsive menu plugin navigation on web page. seems work well, can't figure out how change title of menu when it's closed. want add word "menu" 3 bars or replace 3 bars word. line .js file: meanmenuopen: "<span /><span /><span />", // text/markup want when menu closed, styling in css provides 3 bars these spans i filled line this: meanmenuopen: "<span />menu<span /><span />", // text/markup want when menu closed, styling in css provides 3 bars these spans the css part looks this: .mean-container a.meanmenu-reveal span { display: block; background: #fff; height: 3px; margin-top: 3px; } but solution isn't showing. how can fix that? thank help! got it. king's answer. jquery.meanmenu.js meanmenuopen: "<span /><span /><span /><div class='menu_title'>menu</div>", // text/markup want when m...

filtering - Matlab: How to apply low-pass filter on tf-system for faster evaluation in simulink -

Image
i have mechanical oscillation system defined n x n matrix transfer functions tf( ... ) . w = minreal( [ tf( ... ) ... tf(...) ; ... ; tf( ... ) ... tf(...) ]; in following picture can see selected frequency responses. shows various irregularites @ high frequencies. as combine system in simulink other high-order systems, required step-size has extremely low or system not stable. simulation time tremendously high, makes impossible validate general funcionality of model. for reason i'd apply low-pass filter on fransfer matrix, use bigger steps faster simulation time. there way implement either in matlab code or within simulink? finally adjust threshold frequency depending on how time have , accuracy required. i did research appropriate solvers, without success. advice regarding solvers me well. this meager list of toolboxes have available: control system toolbox version 9.3 (r2012a) simulink control design ...

feedit for non admin users is not working in TYPO3 4.5.26 -

i having site typo3 4.5.26 , have installed advancedfeedit extension. fe edit works fine admin users non admins wont show options though have set ts properly here ts setup : admpanel{ enable.edit=1 hide=1 } anything need ? idea why ? i think hide should 0 admpanel { enable.edit = 1 hide = 0 }

jquery - How do I call a JavaScript function from an erb template? -

if define javascript function , call erb template function not called. why? clicking link should show alert, not. = link_to "add sprout", new_sprout_path, remote: true controller: def new @sprout = sprout.new respond_to { |format| format.js } end then in template call function: # sprouts/new.js.erb dosomething(); the function defined in js files: # javascripts/sprouts.js.coffee dosomething = -> alert "yum ghum new sprout." the javascript comes back. can see in console. see no alert. why doesn't not work? i'm using rails 4. @dosomething = -> alert "yum ghum new sprout." or window.dosomething = -> alert "yum ghum new sprout." # prefer approach, it's more explicit.

Add Javascript to an usercontrol in c# -

i have usercontrol , tooltip . . ascx : <%@ control language="c#" autoeventwireup="true" codebehind="uctooltip.ascx.cs" inherits="portail.formulaires.uctooltip" debug="true"%> <div id="dhtmltooltip" style="z-index:9999999999; display:inline-block;"> <div id="dhtmltooltip_title"> </div> <div id="dhtmltooltip_content"> </div> </div> . cs : using system; using system.collections.generic; using system.linq; using system.web; using system.web.ui; using system.web.ui.webcontrols; namespace portail.formulaires { public partial class uctooltip : system.web.ui.usercontrol { protected void page_load(object sender, eventargs e) { page.clientscript.registerclientscriptinclude("hint", page.resolveurl("~/scripts/hint.js")); } ...

Django South migrations directory outside django project -

i'm trying setup south in way location of migrations directories outside django directory. can use sout_migration_modules change location of directories within django (to every place init file), that's not enough me. unfortunately, sout_migration_modules doesn't accept full paths input. can explain how can make south place migrations directories specified path outside django directory? update: current directory structure: data django project project name settings.py django app migrations idealy south puth migrations folder in data directory, outside entire django project. as takes any module, create module outside project , add python path, e.g.: south_migration_modules = { 'blog': '<my_foreign_module>.migrations.blog', } another way monkey patch south's migrations class, really, should avoid hackery. from south.migration.base import migrations def migrations_dir(self): return #my_ugly_hack migratio...