On Sat, Aug 8, 2009 at 1:47 PM, James West
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:
>
> Karthik Kantharaj wrote:
> #> *how can i access the contract_id which is in another table*
>
> :contract_id=>"#{@contract.id}"
hi James West
Thank you
@agencies=Agency.find(:all,:conditions=>{:deleted=>1,:contract_id
=>@contract,:state_id=>@state})
but i am not able to access :contract_id because there is no field of
contract_id
in agencies table
agencies and contracts contains habtm relation
i am passing this from
<% form_remote_tag(:update =>"searchagencies",:url =>
{:action =>
:searchwithstatus}) do%>
<table>
<th>Contract</th><th>
<%collection_select(:agency,:contracts_id,@contracts,:id,:name,{:include_blank
=>''All''}) %>
</th>
</table>
<% end%>
I need to know how to access the :contract_id
and match with the contract_id in contract table and need to search
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---