similar to: Create a helper for models and views?

Displaying 20 results from an estimated 1000 matches similar to: "Create a helper for models and views?"

2006 Apr 19
8
Module and Model
I am getting the following error /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:1129:in `method_missing'': undefined method `directory?'' for Msg::File:Class (NoMethodError) I have a model called Msg::File in models/msg/file.rb, and I have a file in lib/msg/helper.rb which references to both Msg::File and File.directory? How do I help activerecord
2007 Jul 14
2
Using Helpers inside a Controller
I want to use helpers inside a controller method for an AJAX application. After the page is loaded and displayed, there will be an asynchronous javascript request to load additional resources such as html forms and other data. The controller which handles the request will collect the resources and send them back in json format. def get_resources data=Hash.new data[:form1]=form_helper1()
2006 Nov 16
2
Stubbing helpers
Hi, Is it possible to stub out a helper for development? I''ve got a (view) helper that renders a partial and runs all kind of javascript. But for dev purposes I''d like it to return some hardcoded html. I''m not having any success stubbing the helper out. Something like... test/mocks/development/helper_stub.rb require ''application_helper'' class
2007 May 21
4
Just upgraded to 1.0.0, should render_text isn''t working for me
I finally got around to upgrading from 0.8.2 (!!). I had a spec which looked like specify "should render abc123" do controller.should_render :text => "abc123" get :key end With 1.0.0, the new spec is it "should render abc123" do get :key response.should render_text("abc123") end However it doesn''t work, giving me the error: undefined
2013 Jul 24
12
Want to send password via SMS
Hi I am saving password with hashed_password and salt in table. Now I need to send those passwords via SMS can it be possible.Kindly give me some suggestion plz . Thanks in advance Cheers -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to
2013 Aug 29
2
Need a bit help on "module_function" method
The documentation is very straight forward and the mentioned example also cleared all the lines except the one mentioned inside **. http://ruby-doc.org/core-2.0.0/Module.html#method-i-module_function Creates module functions for the named methods. These functions may be called with the module as a receiver, and also become available as instance methods to classes that mix in the module. Module
2009 Jun 03
3
System V Init Script
Hey Listees, I have a question (hopefully quite simple) about the system V init scripts in /etc/init.d. I have an app installed and for some reason it had no system V init script. It has been installed a long while now so I can't quite remember whats going on but basically I remember I wrote the init script my self and the app is enabled as a service which chkconfig to run at system levels 3,
2008 May 05
2
Deploying to a staging server using Capistrano: how to start up BackgrounDRb?
Hi. I am using BackgrounDRb to process thumbnails and upload to S3 - things are hunky-dory in development (thumbs are generated, these are uploaded to S3, the metadata is saved to trhe DB, and I get a nice status page updated by periodic calls via ask_status), but when I tried to deploy to our staging server and stop/start BackgrounDRb via Capistrano, things blew up - well, not exactly,
2006 Jun 07
6
Links on the left hand side - are components necessary?
Hello, Maybe this is super-trivial... I need to have a list of links on the left hand side of my application, for *every* single page. So, I''ve created a layout called "main" (main.rhtml) under view/layouts, and included >layout "main"< in pretty all of my controllers. main.rhtml has, amongst all the other HTML stuff: <%= render_component
2006 Jan 27
6
Switchtower deploy error
I''m trying to deploy a rails app with no success. I can execute: ''rake remote_exec ACTION=setup'' but when I try to execute : ''rake deploy'' I got this error: loading configuration c:/ruby/lib/ruby/gems/1.8/gems/switchtower-0.10.0 /lib/switchtower/recipes/standard.rb loading configuration ./config/deploy.rb executing task deploy transaction: start
2007 Feb 02
3
rails command version pegging?
Hello, Is it possible to declare the version of Rails used with the seminal "rails /path/to/my_app" command? For example, I now have 1.2.1 and 1.1.6 installed on my machine. If I run "rails my_app" I get 1.2.1 produced skeleton code. Is there a way to get 1.1.6 results? Regards, Andy Koch --~--~---------~--~----~------------~-------~--~----~ You received this
2006 Apr 08
2
Cannot use view helpers in RJS helpers
Any ideas why I would get an error in a RJS helper on view helpers such as number_to_currency. Example: # my_template.rjs page.help_me # my_helper for my_controller def help_me number_to_currency(10) end I have also tired page.number_to_currency but that doesn''t work either. Cheers, Nicholas
2013 Jan 15
7
javascript flash messages gem?
Does anybody knows a gem for managing flash messages? I would want to add messages to the flash div in the client. Bootstrap support is a plus. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group,
2013 Jan 14
9
Need help even generating a new app
I''m having trouble even installing new rails apps. I get to the Bundle run, and it errors on Json, here''s what my error says. I''m new to ALL of this, including Terminal commands, etc. Hope someone can help me out. Runs the Bundler.... then I error out at this: "Installing json (1.7.6) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to
2006 Nov 09
4
Plotting symbols with two positions?
Thanks a lot to Demitris for a prompt answer some minutes ago on another tread (see below). To avoid excess mails on the list, I move onto next question: I have another small plotting problem that confuses me. I want to plot results from a field trial series, using the numbers of the trials as symbols in the plot. pch = as.character(trial_no) works fine, but truncates the trial number to the
2006 Jan 28
1
Switchtower different svn repo urls from my local box and my shared hosting
I got problems running switchtower 0.10.0 when I try to run "rake deploy" from my local box (windows) to my shared hosting If I set the repository to (deploy.rb): set :repository, "file:///home/[my_user]/repo/[my_app]/trunk" My local box (windows) can''t reach the subversion repository located in site5 If I set the repository to: set :repository,
2010 Sep 02
1
Error No such file or directory
Hi, I have a website deployed on heroku, but my local git repository was ereased, so I m trying to create a new local repository pulling my deployed site. I run : git clone -o heroku git-Vgi1d2+GxVTQT0dZR+AlfA@public.gmane.org:my_app.git, but now when I run script/server I get this error msg: pedro@ubuntu:~/proj/my_app$ script/server => Booting WEBrick => Rails 2.3.8 application starting
2006 Jun 16
3
Not able to recognize helper class method in controller!
Hi, Not able to recognize helper class method in controller! When I try to call some method "get_formatted()" in my controller, it says local method not recognized. Please help me out. Thanks, josua -- Posted via http://www.ruby-forum.com/.
2006 Feb 25
1
extending a class
I''m trying to add this to my project: class String def escape_quotes self.gsub(/["'']/) { |m| "\\#{m}" } end end I tried putting it in application_helper.rb, but it''s not getting found. Where does it need to go? Thanks, Chris -- Posted via http://www.ruby-forum.com/.
2003 Feb 26
2
na.action in model.tables and TukeyHSD
Hello everybody! I use R 1.6.2 in Windows, and have a problem controlling the na.action. In a dataset with twelve trials, one of the trials lack any readings of the variable "STS.SH" (standing power at harvest) Fitting an aov() object with the call: led1t7sts.aov <- aov(STS.SH ~ Trial/Block + Treatment + Treatment:Trial, data = led1t7, na.action=na.exclude) seems to work as it