App/views/your_controller/_client.html. Erb The Client is # app/views/your_controller/customer.html. Erb The Customer is 'client', :locals => { :client => @client } %> # app/views/your_controller/client.html.
Erb 'client', :locals => { :client => @client } %> # your_controller. Rb def customer @customer = Customer. Find(params:id) @client = @customer.
Client end def client @client = Client. Find(params:id) # I forget if you need to assign it client to make the partial work client = @client end.
Thanx...one additional question though.. I want to pass the client_id (and client controller to do its work) not the @client obj. – user1019129 Nov 10 at 22:34 I don't follow your question, but I will offer this. A good design principle is thin controllers, fat models.
If you are merely looking to pass the client id instead of the object, then you can modify the above code to do just that. In the view, you would have and in the controller you would set the client_id to the params:id. Good luck!
– sorens Nov 10 at 22:38 thanx, Let me rephrase it ... I can pass the client_id, but if the client information is displayed before the customer information how do I force the customer to be executed first, so that it can acquire the info OR that is exactly what will happen because I use /customer/333. Will try tomorrow..10x – user1019129 Nov 11 at 3:14 hmm.. does not seem to work. The purpose of partial seems to be just rendering partial template.
What I'm trying to do is initiate internal call to a diff URL (mimicking separate request) get the response-data and integrate it into the current template-rendering. So that the Client part can live and be called as separate entity and also be integrated in other controllers output (Customer) – user1019129 Nov 11 at 20:20 either I am not understanding what you are trying to do or you are not understanding what you can do with Rails. You shouldn't need to make a separate request just to keep "the Client part" as a separate entity.
You have access to that model, or any model as it happens, from your Customer controller. In the spirit of trying to answer the actual question, you could use the rest-client gem to make the request you want to the client controller and then use the response in your Customer page. – sorens Nov 11 at 22:50.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.