#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
Top Prev 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 Next
#rubyonrails
<pstickne> i_am_a_local_variable_or_method_name
<tavilach> i know : vs not
<tavilach> i mean :joke vs. :id
<tavilach> is this line correct for passing in an arg to my partial: <%= render :partial => 'joke_item', :locals => {:id => joke} %> ?
<pstickne> no
<tavilach> i want to tell my partial my joke id
<jstew> :id will pass the id as part of the URL
<jstew> in your form
<tavilach> i just want the joke item partial to know which joke id to display
<pstickne> :locals => {:joke => joke}; ..... form_tag :action => ..., :id => joke # suggested
<jstew> just make sure that you really have a variable called joke in your view
<jstew> Whats the error message that you are getting?
<tavilach> no errors right now, its just not doing what i want
<tavilach> a variable called joke?
<jstew> yes, since that is what you're passing into your partial.
<jstew> is your table being generated by something like @jokes.each do |joke|?
<tavilach> yes
<tavilach> that stuff is working, its just my partial stuff that isnt working
<|PiP|> is it a bad idea to post a controller back to itself for form processing?
<bongoman> tavilach: my suggestion ws re the partial
<tavilach> right now i just have a bunch of edit pages all stacked up and then all my joke items under them
<jstew> you are not hiding them in a div then
<bongoman> |PiP|: I do it all the time - use the same action to set up the form and to process it
<tavilach> no i dont need to do that yet, right now i just want the joke edit stuff to be displayed under each joke
<|PiP|> bongoman: do you put a condition (if request.post?) ?
<bongoman> |PiP|: return unless request.post?
<bongoman> then process the incoming params
<jstew> sounds like a simple HTML/CSS issue to me then tavilach.
<tavilach> but my joke_item partial is not knowing which joke id it is editing
<tavilach> well right now
<tavilach> i indeed have an edit page under each joke
<tavilach> edit partial*
<jstew> ok
<tavilach> but the edit partials do not know which joke they are for
<tavilach> when i have an edit *page*, it will display the contents of the joke
<tavilach> so i can change it
<tavilach> but these edit partials do not have the contents of the joke, so there is no editing functionality
<jstew> pastie your controller code and then the view with the partials if you can
<tavilach> should i have controller code for the partial?
<mod_cure> what does the * and & symbol mean ?
<jstew> no
<bongoman> tavilach: you have a controller method for the view and the partial is rendered within that view
<jstew> The partial is part of the same view that is rendering it
<tavilach> pastie: http://pastie.caboo.se/41299
<locellcount> observer is being deprecated? Why would they do that?
<jstew> hmm tavilach what is each joke edit page showing? are they all showing the same thing?
<tavilach> yes they are all blank forms
<tavilach> when they should be forms with the joke inside
<tavilach> wait by edit page i mean the partial
<bongoman> tavilach: do you have a view for edit?
Previous Page Next Page