similar to: help with User.find() and rendering text

Displaying 20 results from an estimated 2000 matches similar to: "help with User.find() and rendering text"

2006 Jan 17
2
actionmailer
I''m getting an error when I''m tyring to use the actionmailer. undefined method `deliver_signup_thanks'' for Notifier:Class This is what I have in the controller. def emailTest Notifier::deliver_signup_thanks() render_text "email test" end This is what I have in notifier model (notifier.rb) class Notifier < ActiveRecord::Base def
2007 Sep 13
3
Templates and undefined variables
Using puppet 0.23.2, I have a template where I wish to do something like this: <% if defined? some_variable %> .... <% end %> Ideally I''d like to tell these three cases apart: a) defined to a non-empty value b) defined to an empty value c) undefined However case c) causes problems - in templatewrapper.rb::method_missing it causes an error to be thrown. I''ve changed
2005 May 17
5
Strings, Variables and GetText
Hi, I''m starting to use GetText and have this code: render_text %(<script language="JavaScript" type="text/javascript"> parent.mainframe.onUpdateNew("Gallery <b>#{@media.name}</b> was successfully created.", "#{@media.name}","#{String(@media.id)}","#{@media.media_type}"); </script>) I need to convert
2005 Dec 26
3
probably a very dumb question
why does <%= render_text "hey ya" %> cause ''undefined method `render_text'' for #<#<Class:0x3851120>:0x3851000>'' can i use render text in a template? -- Posted via http://www.ruby-forum.com/.
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
2006 Jan 07
2
can store array or hash in cookies?
Hi According to rdoc: value - the cookie''s value or list of values (as an array). So, I can use arrays, briliant. But.... It does not work (at least on webrick) I wrote a controller: def check_cookies_first cookies[:chef] = {:value => ["first", "second"], :expires => Time.local (2020)} render_text ":)" end def
2007 Sep 29
2
REXML - XML query only returning one (last) result
I''m really new to Ruby on Rails, and I''m trying to read an XML file with REXML. No matter what I try, I am only getting the last result returned from my query. I should be getting 365 results. Here is the code: include REXML require ''rexml/document'' require ''rexml/xpath'' class MakeFootprintController < ApplicationController def index
2006 Apr 03
9
Problem with Windows not finding methods
I am running (testing) a noob-tube for myself as follows: Windows XP SP2 lighty ruby 1.8.x rails 1.1 scgi I have everything working fairly well, but with one minor exception: the actions that I have defined as follows are not found. class MytestController < ApplicationController def index render_text "Hello Nurse!" end def dilbert render_text "Dilbert
2006 Jul 04
1
Select Box problem in the controler with Ajax
Hi, I have a selectbox that updates a given span area when a user selects a value. The selectbox has the option :include_blank => true. The controler will fetch the ID of the selected option in the combo box and sends the description of the item with the same ID. The problem is that the user is able to select the empty option, and the controler will not be able to fecth the ID. This
2006 Feb 12
3
.empty? Method
I am using: if @post.empty? render_text "Post does not exist." end But it gives me this error: NoMethodError in Posts#view undefined method `empty?'' for #<Posts:0x39598d0> However, if the method list empty? apears and stuff so I am confused. -- Posted via http://www.ruby-forum.com/.
2006 Mar 05
3
Trying to connect tables .....
I am trying to ''connect'' two tables AdHour and Ad in the method below. However, the line with the asterisks is causing the following error: "You have a nil object when you didn''t expect it! The error occured while evaluating nil.user_id" I''ve included the model for both AdHour and Ad. Why doesn''t the script like how I am connecting the
2005 Oct 21
8
Wrong number of arguments (1 for 0) on routes.rb
Hi, I''m baffled by this error. I need a simple controller to send e-mails, so first I thought about just creating the controller manually (without using script/generate), since that didn''t seem to work, I created a dummy table in my DB and used the usual procedure to generate scaffold code. Then I modified the controller to have only two methods, send and compose: class
2006 Jul 10
3
how to access a model from application.rb
Hi All How do I access a model from within the application.rb? What im tying to do is pull some data from a model (news in this case) that must be displayed on each page within the entire application. I know I could drop this into each controller, have each view pull it from the controller, but thats repeating myself... So whats the best way to do this (as I dont think models are visible
2006 Jul 06
2
rjs rails to execute?
I have the following: layout: <%= javascript_include_tag :defaults %> [...] <div id="menu"> <div id="myrandom"></div> <%= render :partial => ''menu'' %> </div> menu partial: <%= link_to_remote "Generate Text", :update => ''myrandom'', :url => { :action =>
2006 Jan 18
5
Exception not caught?
Hello all. I have started reading up on exceptions and tried replacing a manual check with one. Given the following code: def results begin @componentlogs = Componentlog.find(:all, :conditions => [ "cl_compname = ?", params[:componentlog][:cl_compname].strip] ) rescue ActiveRecord::RecordNotFound render_text "<p class=''center''>No
2005 Dec 19
6
custom find methods and pagination
i''ve got several methods in my models i use to find based on certain criteria...i''ve done this so the controller code is less cluttered, plus the DRY factor. example: class Foo < ActiveRecord::Base def find_by_something(something) find :all, :joins => ..., :conditions => ... end def find_by_something_else(something_else) find :all, :joins => ...,
2006 Mar 26
4
Updating query results in real time with AJAX
I have the following view template: <%= form_remote_tag :update => "new_item", :url => {:action => ''create''}, :before => %(Element.show(''spinner'')), :success => %(Element.hide(''spinner'')) %> <div id="new_item"> </div>
2005 Dec 29
1
Has_Many - Saving Child Rows
I have read extensively on has_many but cannot find an explicit example on how to do what I need. I am a newbie, but can grasp it if I see it in a working example. Here is my scenario... I have a form which I can add a TODO item (patterned after http://darkhost.mine.nu:81/~vince/rails/tutorial.html). I have the form working perfectly so I decided to modify it a bit to add more functionality.
2005 Dec 23
6
Stories with many tags, tags with many stories, has_and_belongs_to_many howto?
Hi, I began experimenting with habtm relationships, and so I created a stories table, a tags table, and a stories_tags table referencing the former 2. When I create a "story", I want to add several tags to it. Then, the model should create those tags and link them to the respective stories, and for the tags that already exists, just link them to the story. I tried something like
2006 Mar 22
4
Problem with ACL plugin system
Don''t know if anyone else has experienced this but I''m having a problem with the access_denied method in Ezra''s ACL access control plugin. It''s working fine (in conjunction with acts_as_authenticated) until it comes across a user it denies access to, in which case it throws the following error: NoMethodError in Admin#index protected method