search for: render_action

Displaying 20 results from an estimated 51 matches for "render_action".

2006 Jun 16
2
image_select_tag with name and value
What have I missed I have a .rhtml with the sandard form parameters <%= image_submit_tag("excel.gif", :alt => "Download List to Excel", :border => 0, :name => ''render_action'', :value => ''excel'' ) %> Which genenerates I believe a valid html fragment for a submit button. <input alt="Download List to Excel" border="0" name="render_action" src="/images/sapexcel.gif?1149227900" type="image&q...
2007 Apr 17
1
controller.should render_action ?
Hi Is there a render_action matcher to go with render_template? I can''t see any mention of one in the docs. Do you have to still do it old- school? Thanks Ashley
2005 Mar 10
4
error messages, loops and saves, actionmailer and finaly authentication
...s_for "objectName". So there are a couple questions that go with this. a) If there is no errors being passed to the action then I get an error. How do I check to see if an error is being passed and if so show error_messages_for? b) From what I understood while playing around if I use a render_action the error message will be passed but if I do a redirect_to the errors are not passed. How can I use a render_action when the action I want to render if I get an error is in another controller? 2) This is a continuation from a question from before. Instead of deleting a record I mark it as delete...
2006 Jan 19
1
Rationale behind render opposed to render_action
Guys, What was the rationale behind moving to the swiss army-ish method of render(:X), as opposed to the various render_X methods that existed before? I find it easier to keep the render_X style in my brain, rather than trying to remember what the valid parameters to render() are. It''s also more code completion friendly. Just curious. Thanks, John -- Posted via
2005 Sep 19
1
help with has_one relationship??
...saved. Anybody care to shine a little illumination this way? def create @product = Product.new(params[:product]) if @product.save @picture = Picture.new(@params[:picture]) if @picture.save redirect_to :action => ''products'' else render_action ''new'' end else render_action ''new'' end end cheers Neale
2006 Jun 19
0
Bug? With image_select_tag processing in controller?
As I wrote in http://www.ruby-forum.com/topic/69600 A) I created a .rhtml <%= image_submit_tag("excel.gif", :alt => "Download List to Excel", :border => 0, :name => ''render_action'', :value => ''excel'' ) %> B) This rendered the valid html <input alt="Download List to Excel" border="0" name="render_action" src="/images/sapexcel.gif?1149227900" type="image" value="excel" /> Thus...
2005 Jan 07
3
multicolumn primary keys in activerecord
hi, I''ve got the following tables in mysql notation: CREATE TABLE `nodes` ( `id` int(11) NOT NULL auto_increment, `parent_id` int(11) default ''0'', `group_id` int(11) default ''0'', PRIMARY KEY (`id`), ); CREATE TABLE `groups` ( `parent_id` int(11) NOT NULL default ''0'', `id` int(11) NOT NULL auto_increment,
2006 Jul 13
1
error_messages_for
...@product = Product.find(params[''product_id'']) end def create @Record.new(params[''record'']) if @record.valid? @record.save redirect_to :action => ''show'', :id = @record.product_id else render_action ''new'' end end end view-------------- <%= error_messages_for ''Record'' %> <form action ="../record/create" method = "post"> <input id = "record_product_id" name = "record[product_id]" type="hid...
2006 May 18
6
Newbie:problem when using validates*
Hi, I have performed the cookbook tutorial. Before tailoring the views and controllers, when I put in the model recipe.rb: validates_uniqueness_of :title validates_length_of :title, :within => 1...20 And I tried to introduce some new recipe without the above conditions I got the message: --------------------------------------------------- New recipe 1 error prohibited this category from
2006 Feb 02
2
uninitialized constant
...d name), @params[''sort''], @params[''order''], ''icao'', ''ASC'' @pages = Paginator.new self, Airport.count, 10, @params[''page''] @airports = Airport.find_all nil, @sorter.to_sql, @pages.current.to_sql render_action ''none'' if 0 == @airports.length end Can anyone help? If you need more information I will give it if I can. BTW, I''m a RoR newbie so if this is something really simple, I''m sorry. -- Posted via http://www.ruby-forum.com/.
2007 Jun 19
5
Problems translating should_render from 0.8.2 to 1.0.5
<font size="2">I''m working on a large Rails site and we want to move from RSpec 0.8.2 to the latest and greatest.&nbsp; So we ran the translator and yet we''re having a lot of trouble translating should_render.<br><br>I found this on the web:<br><br>We will NOT be supporting the following in the new syntax:<br>&nbsp;
2006 Jul 21
3
Specifying a view template
...to Rails (and liking it!) and I have multiple controllers, each of which has a method which uses a view template which is identical to what the others use. I would like to be able to have just one template to maintain that they can all use. What is the customary way to do this? I tried using render_action to specify the template explicitly, and it "works". But I would like to be able to redirect to this method without getting a "Can only render or redirect once per action" error. Thanks for any assistance! -Steve Bergman -- Posted via http://www.ruby-forum.com/.
2006 Jan 11
7
Create a relationship with 2 or more tables on 1 insert
...39;']) @userdetail = Userdetail.new(@params[''userdetail'']) if @user.save and @userdetail.save flash[:notice] = "Save succeeded..." redirect_to :action => ''list'' else flash[:notice] = "Save FAILED" render_action ''new'' end end [/code] I want to put the auto_incremented id of the first table(userstable) into the user_id field of the second(userdetails) table or is there a better way to do a multiple insert and at the same time create a relationship thanx tim -- Posted via http:...
2005 Jun 13
3
validations not working with collection population droplists
...; /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/benchmarking.rb:23:in `measure'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/benchmarking.rb:23:in `render'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/base.rb:447:in `render_action'' app/controllers/reviews_controller.rb:91:in `create_curriculum'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/base.rb:708:in `send'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/base.rb:708:in `perform_action_without_filters'...
2006 Mar 26
4
Updating query results in real time with AJAX
...ory.save @new_item = Category.find_by_sql("select max(category) as last_category, id from categories") render_text "<tr><td>" + @new_item[:id] + "</td><td>" + @new_item[:category] + "</td></tr>" else render_action ''new'' end end I''m a complete newbie, any help would be appreciated. Thanks, Bill -- Posted via http://www.ruby-forum.com/.
2007 May 08
3
How to restore fields ("validates_presence_of")
Hi all, I am using "validates_presence_of" for validating all fields of my registration form. It is working fine and generating custom error message as mentioned. Also clearing all fields. How can restore those fields which are already filled. Problem is "validates_presence_of" clearing (blank) field if it fails, instead of restoring fields which are already filled. Help.
2006 Jun 07
0
2nd Submit button with options
I wish to have 2 submit buttons one which does a normal sumbit and the other that does a submit but also passes the parameters such as "render_action" . This doesnt work <%= start_form_tag :action => ''list'' %> <%= image_submit_tag("find.gif", :alt => "Find and Display", :border => 0) %> <%= link_to image_tag("excel.gif", :alt => "Find and Download to Excel&qu...
2006 Apr 19
1
validates_presence_of
...gt; 17: <%= category.name %> 18: </option> the def create controller looks somthing like this def create @recipe = Recipe.new(@params[''recipe'']) @recipe.date = Date.today if @recipe.save redirect_to :action => ''list'' else render_action ''new'' end end any suggestions to where im going wrong? -- Posted via http://www.ruby-forum.com/.
2006 Apr 04
11
Date/Time format and syntax
Hi, Just wondering how I get both the current date and time to display here (so far I can only get the date OR the time): @tblregisteredphone.txtregisterdatetime = Date.today Also, how can I change the format of the date and time from: Tue Apr 04 00:00:00 GMT Daylight Time 2006 to 2006-04-04 12:04:00 ?? I''m sure it''s very simple, I just don''t know how
2006 Jan 10
15
KISS and DRY? Not even close!
....find_by_sql(''select t1.name, t2.first_name, t2.last_name, t2.id from companies AS t1, contacts AS t2 where t1.id = t2.company_id order by t1.name'') @contacts_list = @contacts_list.collect { |c| [ c.name + " - " + c.first_name + " " + c.last_name, c.id ] } render_action ''new_project'' end def create_project @contact = Contact.new @project = Project.new(@params[''project'']) @project_contact = ProjectContact.new(@params[''collect'']) @project.project_contact = @project_contact contact = Contact.f...