#apache #archlinux #asterisk #centos #debian #gentoo #haskell #kde #kubuntu #lisp #math #mysql #perl #python #ruby-lang #rubyonrails #suse #ubuntu #vim #wikipedia 0 1 2 3 4 5 6 7 8 9 10 11 12 
Top Prev 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 Next

#rubyonrails

<tavilach> yes
<bongoman> You're rendering the partial in your list view not in your edit view?
<tavilach> yes
<phI||Ip> Hi everyone, I have a question... Im an ASP.NET developer by trade, but Ive decided to re-implement a lame CMS app from .NET to ROR to test it out...
<phI||Ip> I know scaffolding is not a long term solution, and I dont plan to keep it... but for the sake of understanding and data manipulation, how can I view my relationships in the scaffold?
<tavilach> hey actually jcrew
<tavilach> the partials DO know for which joke they are for
<jstew> locellcount: observers are not deprecated, only the way that rails handles observers.
<tavilach> i just put : <%= link_to 'Edit', :action => 'edit', :id => joke %> inside the partial, and it links properly to the specific edit page that it should link to
<jstew> you have to specify them in you environment.rb now.
<tavilach> the partials know their ids, but they're not displaying the proper information, how odd
<tavilach> the forms are just totally blank, something isnt being passed into the forms..
<bongoman> tavilach: you're rendering the form partial in the joke_item partial yeah?
<jstew> tavilach, then the partial is getting the local passed correctly. The form fields could possibly be incorrect
<tavilach> yes
<tavilach> ok but the form partial render
<bongoman> tavilach: so you need to pass the locals into the form partial then
<tavilach> is a copy paste from the edit one
<tavilach> why doesnt the end one need that?
<bongoman> try pasting the form partial content back into joke_item partial then try
<jstew> because it has access to an instance variable (@)
<tavilach> what does?
<jstew> in a partial you can only reference your locals of an instance variable from the controller
<jstew> s/of/or
<jstew> sorry
<tavilach> but the form partial
<tavilach> does not mention @joke
<phI||Ip> When you are using images in various routes... how do you easily figure out the proper path?
<bongoman> tavilach: so how can it display joke info to be edited?
<tavilach> i dont know!
<tavilach> the form partial says: <%= text_area 'joke', 'body' %></p>
<tavilach> is 'joke' the same as @joke?
<jstew> you need :locals => {: joke => joke} for your form partial like bongoman said
<tavilach> i put that in my render partial inside joke_item
<tavilach> when i call the form partial
<tavilach> but that didnt fix it
<tavilach> do i have to edit the form partial
<BucWheat> pstickne what is the proper tag to update all <tr> with ajax?
<tavilach> bahh lol
<wilfordbrimley> is it possible to use a model as a join table that's polymorphic..ie to implement generic favoriting between different model objects?
<jstew> ok tavilach I think I figured it out
<tavilach> yayy
<Skiz> wilfordbrimley: generally thats what STI is used for
<jstew> the field helpers expect an instance variable not a local variable
<Skiz> polymorphs are for associating different types of ojects
<tavilach> ah
<jstew> in your main view do @jokes.each do |@joke|
<tavilach> haha i see, i actually understand that, lemme try it
<jstew> and you can reference your @joke in your partials without the need for :locals
<tavilach> YESSS

Previous Page  Next Page

Search ircarchive.info