Can you not <%= render :action => "x" %> in a view?

Have I gotten stupider? I can seem to get this to work. It seems that absolutely nothing happens when I do a

<%= render :controller => "patients", :action => "new" %>

in a view.

Is it not possible? Am I supposed to use RJS?

<--

<table cellpadding="0" cellspacing="0" width="100%"> <tr> <td style="text-align:center;color:gray;"> Create a new patient below or <span style="color:#0066cc;"> <%= link_to_remote "Select an existing",     :url => { :action => "get_form_for_facesheet", :id => "1" },     :update => { :success => "step_1_display"},     :loading => "document.getElementById('ajax-loader').style.display = 'block';",     :complete => "document.getElementById('ajax-loader').style.display = 'none';",     :html => {:style => "color:#0066cc"} %> </span> one. </td> </tr> <tr> <td> <% render :action => "patient/new" %> <input type="hidden" id="patient_id" name="patient_id" /> </td> </tr> </table>

-->

Hi Alex,

Alex Williams wrote:

I can seem to get this to work. It seems that absolutely nothing happens when I do a

<%= render :controller => "patients", :action => "new" %>

in a view.

Is it not possible?

Not possible that I know of. Certainly not good practice even if it were. What you'd normally use render for in a view is to render partials, which it sort of looks like you're trying to do...

Am I supposed to use RJS?

... except that you're using link_to_remote which sends an xhr to the server which, yes, would lead one to believe you're going to render that partial using RJS.

From the view below, it looks like you're interested in the use of Rails in healthcare. As an aside, I recently open-sourced my first 'big' Rails app. It's an app using CCRs for new patient registration. You might find it interesting. Perhaps even helpful. It's at http://rubyforge.org/projects/ccredit

Best regards, Bill

Bill Walton wrote:

Hi Alex,

Not possible that I know of. Certainly not good practice even if it were. What you'd normally use render for in a view is to render partials, which it sort of looks like you're trying to do...

... except that you're using link_to_remote which sends an xhr to the server which, yes, would lead one to believe you're going to render that partial using RJS.

From the view below, it looks like you're interested in the use of Rails in healthcare. As an aside, I recently open-sourced my first 'big' Rails app. It's an app using CCRs for new patient registration. You might find it interesting. Perhaps even helpful. It's at http://rubyforge.org/projects/ccredit

Best regards, Bill

Well the reason why is to use activescaffold's new action. It takes a crap on you if you render it's forms, so I was trying access the action directly.

Hi Alex,

Alex Williams wrote:

Well the reason why is to use activescaffold's new action. It takes a crap on you if you render it's forms, so I was trying access the action directly.

It's easy to get 'wrapped around the axel' with routes, and especially nested routes. My personal recommendation is to delete the routes stuff that's being scaffolded for you, make the app do what you need it to do, then add back the stuff that _might_ help you make the code base smaller.

HTH, Bill