Displaying 20 results from an estimated 112 matches for "render_text".
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 method `render_text'' for #<#<Class:0x32ebdac>:0x381a454>
I installed the 1.0.0 rails plugin, and ran script/generate rspec
again. Any ideas as to what''s wrong?
Pat
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}");
</scrip...
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 Sep 29
2
REXML - XML query only returning one (last) result
...require ''rexml/document''
require ''rexml/xpath''
class MakeFootprintController < ApplicationController
def index
file = File.new("#{RAILS_ROOT}/xml/footprints.xml")
doc = Document.new(file)
doc.each_element(''//day'') { |day|
render_text day
}
end
end
Thanks for the help.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.o...
2006 Mar 29
0
placing specific views within a subdirectory?
...s/hello/english/people.rhtml
views/hello/spanish/mundo.rhtml
views/hello/spanish/gente.rhtml
instead of the usual:
controllers/hello.rb
views/hello/world.rhtml
views/hello/mundo.rhtml
hello.rb currently contains the basic methods:
class ChartsController < ApplicationController
def world
render_text("hello world")
end
def mundo
render_text("hola mundo")
end
def people
render_text("hello people")
end
def gente
render_text("hola gente")
end
end
Ideally, It would contain sub methods or something similiar I would htink :-\
class ChartsController &...
2007 Jun 10
0
pb when posting to an action "render_text body, :status => 400"
...rails.
I encounter a very strange problem for me, you can see all the story in the
openid mailing-list :
http://lists.openidenabled.com/pipermail/dev/2007-May/000666.html
http://lists.openidenabled.com/pipermail/dev/2007-June/000700.html
In short, the problem is :
the server has to do a "render_text body, :status => 400" to respond to a
post from a consumer. (this is from the openid server example)
This is working fine with webrick, but not in mongrel 1.0.1 on osx where the
consumer get :
Net::HTTPBadResponse: wrong status line: "HTTP/1.1 0 "
If someone wants to try, just...
2007 Jun 10
0
pb when posting to an action "render_text body, :status => 400" (resolved)
Sorry for my previous mail,
If I do
render :text => "test", :status => 400
instead of
render_text "test", :status => 400
every one (ie. mongrel & webrick) are working fine !
Sorry.
Arthur
2006 Jan 07
2
can store array or hash in cookies?
...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 check_cookies_second
begin
render_text "cookies class is: " + cookies[:chef].class.to_s + "
value: " + cookies[:chef]
rescue Exception => e
render_text "Why this don''t work? exception: " + e....
2006 Apr 03
9
Problem with Windows not finding methods
...m 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 rocks!"
end
end
If I browse to 127.0.0.1 I get the default page, but if I then go to
127.0.0.1/mytest/index or ../mytest/dilbert, then I get the following
rather exciting error:
Unknown action
No action respon...
2006 Aug 16
8
Multiple (AJAX) Observers on the Same Field and MSIE
I have been using multiple observers, i.e., observe_field(), on the same
input field and relying on them to execute in the same order that they
appear in the page. This has been working fine in FireFox, but it does
not seem to work in MSIE; the requests come in and are processed in a
different order. Now, I''ve always been a little hesitant about using
this technique, but it always
2005 Oct 21
8
Wrong number of arguments (1 for 0) on routes.rb
...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 MailsController < ApplicationController
def compose
render_text ''composing''
end
def send
render_text ''sending''
end
end
And I have these routes defined:
map.connect _(''mail/:id/send''), :controller => ''mails'', :action => ''send''
map.connect _(''mail...
2006 Aug 16
0
Multiple observer
...;
@html += "<option value="">Select City</option>"
@cities.each do |@city|
@html += "<option
value=''#{@city.id}''>#{@city.city_name}</option>"
end
@html += "</select>"
render_text @html
end
def select_locality
@localities = Locality.find_all_by_city_id(@params["id"])
@html = "<select id=''locality_id''
name=''home_for_rent[locality_id]''>"
@html += "<option value="">S...
2006 Aug 17
0
AJAX - Having Multiple SELECT (Drop Down), and dependency
...;
@html += "<option value="">Select City</option>"
@cities.each do |@city|
@html += "<option
value=''#{@city.id}''>#{@city.city_name}</option>"
end
@html += "</select>"
render_text @html
end
def select_locality
@localities = Locality.find_all_by_city_id(@params["id"])
@html = "<select id=''locality_id''
name=''home_for_rent[locality_id]''>"
@html += "<option value="">S...
2006 Jul 04
1
Select Box problem in the controler with Ajax
...to select the empty option, and the
controler will not be able to fecth the ID. This provides the error:
Couldn''t find Item with ID=
The id is blank, and this is why it shows the message.
The code of the controler is:
def display_item_description
item = Item.find(@params[:id])
render_text "<p>" + item.description + "</p>"
end
I know I need to perform some kind of check on the @params[:id], but I
don''t know how to do it.
Thanks in advance,
Gama Franco
--
Posted via http://www.ruby-forum.com/.
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/.
2005 Nov 18
2
help with User.find() and rendering text
...orks the way I think it works, the sad part
is I always get it wrong) anyways, The entry in the data base with the
given user name gets searched and the user info gets stored in the
variable @user.
On line 4: Now how do i print it out? Is it a variable.
1. @some_variable = @params[:user_name]
2. render_text @some_variable.to_s
3. @user = User.find(:all, :conditions => [ "user_name = ?",
''@some_variable''])
4. render_text @user.to_s
I''m very sorry for this long and anoying post. I''m new to this and
really need help!
Thanks
S
--
Posted via http://w...
2006 Mar 05
3
Trying to connect tables .....
...Why doesn''t the script like how I am connecting the tables??
Thank you!
----------------------------------------------------------------
def edit
userid = @session[:user].id
@ad_hour = AdHour.find(@params[:id])
***** if (@ad_hour.Ad.user_id != userid)*****
render_text "You do not have permission to modify this ad." and
return
end
end
class AdHour < ActiveRecord::Base
belongs_to :ad
end
class Ad < ActiveRecord::Base
has_one :ad_hour
end
--
Posted via http://www.ruby-forum.com/.
2006 Jan 18
5
Exception not caught?
...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 matches found</p>"
else
render :partial=> "componentlog"
end
end
If I searched for a nonexistant record I would expect the exception to
be raised and caught. What is actually happening I am not sure. All I...
2006 Jul 06
2
rjs rails to execute?
...gt;
<%= render :partial => ''menu'' %>
</div>
menu partial:
<%= link_to_remote "Generate Text",
:update => ''myrandom'',
:url => { :action => ''myrandom'' } %>
myrandom :
def myrandom
render_text "here is some text"
end
myrandom.rjs
page.visual_effect :highlight, ''myrandom'', :duration => 3
When I click action, the text is rendered, however the rjs does not
seem to take effect, I was trying to get rjs working in a more
complicated scenario, but hopefull...
2005 Aug 07
8
Ajax forms and redirects
Here is an example that seems perfect for Ajax that I have not seen
implemented nor can figure out how to do it. I am hoping someone can
give me some pointers.
On the sign-up page, I would like to do my validations (password
length, username uniqueness,etc ) Ajax-style. But if all validates,
then redirect to the success page. The combining of redirection to a
new page with Ajax is throwing me.