text:
Q: Datetime form with text_field Is there a way to have a text_field just for the date part of a datetime attribute?  For example, I have a datetime parameter called published_on, and I'd like my text_field to only submit for the date of the datetime field (not the time).  This didn't work:
<%= f.text_field :published_on, :value=> (@step.published_on.strftime("%m/%d/%Y")), :ignore_time=>true %>

and submits the parameter published_on rather than published_on(1i), published_on(2i), and published_on(3i) (for the year, hour, and minute).
Edit
I'm able to get the parameters now, but I have a time zone error
This is my controller code:
date = params[:step][:published_on]
logger.debug "date: #{date}"
time = params[:step][:"published_on(4i)"] +":" + params[:step][:"published_on(5i)"]
logger.debug "time: #{time}"
dateTime = date+ " " + time
logger.debug "dateTime: #{dateTime}"
dateTime = DateTime.strptime(dateTime, '%m/%d/%Y %H:%M')
logger.debug "datetime: #{dateTime}"

params[:step][:published_on] = dateTime

params[:step].delete :"published_on(4i)"
params[:step].delete :'published_on(5i)'

which prints the following log statements:
date: 01/01/2013
time: 00:00
dateTime: 01/01/2013 00:00
datetime: 2013-01-01T00:00:00+00:00

It seems like the time is incorrect since the timezone is set to the default (00:00).  Is there any way to get the timezone passed from the form?

A: In your form, use the text_field without the :value option.
In your controller, try:
@your_model.published_on = DateTime.parse( params[:published_on] )

This will set the date, and leave the time-portion as 00:00 midnight

A: Do you have to have a text_field in the view?
As far as I can tell, you can have a date_time field and then just use two different input fields to set the different parts of the field.
form_for @event do |f|
  f.date_select :starts_at
  f.time_select :starts_at, :ignore_date => true
  f.submit
end

Since the rails date and time select helpers set five different parameters (starts_at(1i) for the year part, 2i for the month part, and so on), that means that the date_select only sets them for the date part, while if you pass :ignore_date => true to the time_select, it will only set the hour and minute part.
If you must have a text_field I'm not sure how to do it, but it might be possible to do using some jQuery magic before setting the datetime parameters before sending the form.

A: I finally figured it out thanks to a lot of Tilo's help.
This is what I have for my form:
<%= semantic_form_for [@project, @step], :html => {:multipart => true} do |f| %>
    <%= f.inputs do%>
        <%= f.text_field :published_on, :value=> (@step.published_on.strftime("%m/%d/%Y")), :ignore_time=>true %>  at <%= f.time_select :published_on, :class=>"btn dropdown-toggle", :ampm=> true, :ignore_date=>true %>
          <%= f.input :timeZone, :as=> :hidden, :value=> @step.published_on.zone%>
    <% end %>
<% end %>

and my controller:
 def update
    @step = @project.steps.find_by_position(params[:id])
    @step.images.each do |image|
      image.update_attributes(:saved => true)
    end
    date = params[:step][:published_on]
    logger.debug "date: #{date}"
    time = params[:step][:"published_on(4i)"] +":" + params[:step][:"published_on(5i)"]
    logger.debug "time: #{time}"
    timeZone = params[:step][:timeZone]
    logger.debug "timeZone: #{timeZone}"
    dateTime = date+ " " + time +" " + timeZone
    logger.debug "dateTime: #{dateTime}"
    dateTime = DateTime.strptime(dateTime, '%m/%d/%Y %H:%M %Z')
    logger.debug "datetime: #{dateTime}"

    params[:step][:published_on] = dateTime

    params[:step].delete :"published_on(4i)"
    params[:step].delete :'published_on(5i)'
    params[:step].delete :timeZone

    respond_to do |format|
      if @step.update_attributes(params[:step])
        format.html { redirect_to project_steps_path(@project), :notice => 'Step was successfully updated.' }
        format.json { head :no_content }
      else
        format.html { render :action => "edit" }
        format.json { render :json => @step.errors, :status => :unprocessable_entity }
      end
    end
  end

It seems sketchy to define a bunch of parameters for the same object and delete them later, but I didn't know any other way around it.


In a mountain river by a limekiln lives a water-sprite. His name is Emil.
For work he participates in a sleep study run by studious monks who compare circadian and liturgical rhythms. Just imagine! Every Saturday he checks in at the cloister refectory, presents his dream-books and diaries, and receives dream-intensifying pills that he doesn't use – the sounds of the river and the lime works share with him more than enough dreams. His waterproof notebooks amaze the monks the most. What do they know about water-sprites! Most people can't tell water-sprites from humans. Some take all sprites for humans while others call everyone a sprite.
In the old days, Emil cleaned cellars, as has been customary among water-sprites. But since the friars take Emil for a human and pay him with meal tickets, he is freed from old customs and visits instead a local goldfield two miles down the river.
Emil rises out from the river only when no one else is around, to hide that he is a sprite. So well does he hide it that even he occasionally forgets. When that happens, he shivers like a human, dries his body up with bluebells and hornworts, and gazes at the river until the evening bells drop the sun into the water. Once on his knees, Emil fears he'll drown, the way he did as a human two centuries ago. That's how long he's been a water-sprite. His wife Terka is younger. She drowned during the war and soon after that married Emil. Actually, some soldiers drowned Terka and her sister in a vat of lime.
It's Saturday. After three years, the study has run its course and today is the last meeting. Emil hands in his impermeable notebooks for good. The friars say a farewell mass to bless the study and ask grace and safeguard for wayfarers that come through the mountains. Although he'll get no more meal tickets from the friars, Emil, without a thought about looking for work cleaning cellars, sets out for the goldfield. Walking on dry land, he looks through the cloister garden fence at a fishpond. The garden marks the end of a grove. Not a soul is in sight. The sunshine looks artificial.
The sprite arrives at a crossroads.
A man stands there, waiting for him. It is Sasha, the wandering schizophrenic who trades in gold objects, and sells gold and jewellery to Emil in exchange for meal tickets. Without a word, Emil gives Sasha his last meal tickets, collects the gold, stuffs it in his pockets and keeps walking. When he reaches the goldfield site, he enters the river, dives to the bottom and pushes the gold from his pockets into the water. This is how water-sprites create goldfields nowadays. It is another one of their responsibilities. The sun is setting but Emil doesn't want to leave. He pushes his green hands in the water, bends and scoops the sand from the bottom. It drips with gold water and Emil lets it slowly out of his fingers again.
The gold sinks. It's time for vespers. Emil climbs out of the water and starts walking back toward the monastery. From the open cloister door sound the evening praises. The monks chant after a day of silent labor, "… there is time that returns and time that progresses to a destination".
Through the dark air, stars are falling; some alone, others in clans. Emil lies down, his back in the grass, half-closing his eyes, looking at the water, his home. He turns on his side, then on his stomach, and finally rolls over into the water.
He is several yards from his family. Through the waves, he sees Terka lying in the reeds. The moon lightly touches Emil's shoulder and Emil looks up. Layers of water are forming around the moon a blue sapphire ring. Is it the one he lost?
The water splashes against the table, chairs and the old pre-war refrigerator. Emil floats by the two little sprites, whom Terka tucked in under the water-lilies. Then he lies down in the reeds next to her.
Terka still remembers her life before she perished, remembers where she lived. The dracaena in their living room looked like a palm. The palm didn't like light or shade and its lower leaves turned yellow. Usually, nothing in the house worked. The roof leaked and one faucet did, too.
It was autumn in the mountains. They had to run away. Terka, mother, father and little Olinka put on several layers of warm clothes and ran along the river into the mountains. They decided to hide in the limekiln. The girls knew that above the tub was a crawlspace. Its door could be secured with a wooden beam. Terka used to bring Olinka there to play and once the girls dragged a large beam to the hideout. That came in handy now because in the worst case, the beam could be used as a footbridge.
Suddenly Terka wakes up and realizes she is lying in the reeds, in her present life, in the wet moonlight. Neither she nor Emil knows that Sasha goes every night to the river goldfield. Tonight is no different. He dives to the bottom, searching for gold to exchange for meal tickets. In turn, he doesn't know that the study is over and there will be no more meal tickets. When he finds Terka's sapphire ring on the river floor, he decides to return it tomorrow to Emil, for meal tickets.
It was autumn. They had to escape and decided to hide in the mountains, at the limekiln hideout. Olinka was crying. She was cold and didn't want to go to the kiln. They gulped down a few bites, finished the soup from yesterday. Then they wrapped up the rest of the bread and a potato in a towel and her mother took out two onions from a drawer. She put the food in her brown coat pocket. Carefully, they shut the door and through a musty granite hallway walked out of the house. The air was clear, frozen. Birds were screeching into the night.
Sheila stands alone on the beach, ankle-deep in the water. The ocean is calm. Wearing her new white culottes that she bought special for the honeymoon, she admires the bronze horizon, that line that forms a boundary between the earth and sky. Then, she hunches over and makes herself throw up in the water, catching some in her hands the way she likes. Nothing splatters onto her clothing. She about-faces to wash her face and mouth out with the untainted water. Straightening up, Sheila happily sighs at the sky with her hands on her hips before stepping onto the shore. Birds are circling in the distance.
In the quiet moments that only the beach can offer, she sifts sand through her toes to secretly exfoliate any calluses, and thinks of the Indians. Their dirty sweat lodges and wet towels. She hates them. It makes her shiver just to think. She checks her fingernails, flexing her hand, examining her engagement ring, how it fits like a puzzle with her wedding band. They had to get the rings re-sized twice, a fitting she still takes as a compliment to her delicate fingers, so lady-like they can scarcely hold a fork upright. They use chopsticks or drink soup from the bowl at dinner. Tennis has become near impossible. Her life, she thinks, is very tiring. Even mundane tasks can be exhaustive when completed with virtual perfection.
Burt surprises her from behind, grabs her shoulders, massaging. "How long had he been there?" she wonders and groans in submissive happiness at his strong hands. He's naked from the waist up. His swimming trunks are burnt sienna with a pattern of the alphabet, scrambled and interlocking.
"That feel good?" Burt asks.
"Yes." Sheila groans again, and at this Burt massages harder until she can't take it anymore, and turns around and kisses him, open mouth. They both laugh laugh laugh, then sigh up at the sky. Just as he chooses to ignore her taste, she ignores the seagulls crying and swooping down. Burt's happy he's with Sheila. Is 23 too early for marriage? Should they start trying to have kids? No. Not yet. He wants her all to himself for a few more years. He buys her dresses for occasions they'll never have. She wanted a floral summer dress in February and when he asked why, she said, "For frolicking in the field," so he charged it to his card. "The honeymoon is the tip of the iceberg," he thinks. He sees the two of them skiing down icebergs. Sipping champagne on icebergs. Making love in a pool of melted iceberg.
"Burt, last night I was reading my book and watching TV. And I remembered falling in love with you in high school when you were the student director for A Midsummer Night's Dream and I was a fairy, and I remembered something so funny last night," she starts, her tiny hands fiddling about, trying to find something to hold on to on his gigantic smooth chest and failing.
Burt distantly nods, smiling, and brushes blonde hair out of his eyes then her eyes.
The water in the ocean is as still as a lake, with a few ripples.
"I'm bulimic again," Sheila says.
"Wow." He wipes his mouth, wishes he had some ChapStick, doesn't know what to do. She seems fine. "You're alright. God Sheila, you're more than alright. You're you," he stresses, and in the quiet that ensues, he's sure he sees a bloody figure in the distance getting pulled under water, maybe by an animal of some kind. Or maybe it's just drowning alone. Birds are circling the air. He shakes his head and tucks little Sheila under his chin.
"You're not your father, Sheila. You're you." He doesn't know why he keeps saying that. "You shouldn't throw up anymore. You've got such good teeth." Whatever he sees in the water is scrambling helplessly, the birds swooping down for a taste of the prey. He doesn't mention this to her.
They embrace. Wind twines their silken hair together.
From under Burt's chin, all Sheila sees is his throat, too close to make out anything but the fabric of his skin pulled tight over a pulse. All she ever wanted was to be that thin, so that her heart would be that much closer to the outside of her clean, polished body. "I went to Weight Watchers. They barely let me join because their rules stated I may have been too thin for my height but when they weighed me I was fat enough to join and since then I've spiralled out of control. One woman had been in Weight Watchers since Nixon was in office." Between both their bodies her hands roll at the wrist to keep the beat of her words, like musical meat in a Burt and Sheila sandwich.
"I used to live next-door to Nixon." It was true. His dad and Nixon went hunting once and a picture of them was on the refrigerator.
"I love you," she says. They embrace. Sheila buries her head in Burt's hulking shoulder and weeps. "The beach is beautiful," she says, and presses her cheek to him.
Sheila shakes her head at him.
Sheila weighs her options and, tracing a bowed line in the sand with her manicured toe, thinks again of the Indians. She remembered reading about how they use deer blood– or maybe it's buffalo blood — to paint their face before a ceremony for the purpose of warding off evil spirits, or to intensify the idea of the actual presence of a supernatural person. But she couldn't understand why she herself felt the same inclination to change the angles of her face into the likeness of precious stones. She never had an evil spirit; maybe she never had any spirits.
"I'll sign us up for a colonic tomorrow. It'll be like a new beginning," he says.
As she says this, Burt bends over, perhaps to pick up a shell. Maybe an oyster.
He was spreading cream cheese on the bagel.
he held it to his eye.
When his eyes opened he saw her.
meeting his through the cream cheese.
he could see her freckles.
The Bright Snake gapes to heaven above.
his jaws have crushed the Chosen One.
Thin threads of time have come undone.
and vineyard vines have come ungraped.
their praying legs are straight: unkneeled.
all the money's come unminted.
to a silver river, flows.
and empty air is all it holds.
The world after the Ragnarök.


« See you on the Cabela's Awesome Upland Road Trip!
Q&A … maybe one for you?
Q: What is the best method to convince your children to not undo your dog's training? Every bit of progress seems to be undone, for instance, by the kid's uncontrollable urge to play tug of war with the dog, etc.
A: Train your kids too. Get them to help in your training and it might have more relevance to them. They'll have to deal with their misdeeds.
Q: Is it easier for a dog to understand two commands "sit" and "stay" or is it easier to teach a single command for sit and stay by just saying sit or in spaniel circles hup?
A: I like to keep it simple. A dog should obey the command until released or given another command. When he "sits," he sits, until told to do something else.
Q: Scott, I live in the big city and own a young GSP. What do you think is the best way for me to keep my dog in shape for hunting? Not only physically but also her bird finding skills?
A: Running alongside your bike (attached via a rig like the "Springer") would be good for physical conditioning. Even a small backyard can be used for fundamental bird contact, especially combined with a long drive once a week to a spot where you can let your dog stretch out and find birds in a more natural setting.
Q: Is it OK to "rough house" with my dog while playing with him or does that hurt his discipline?
A: I do it occasionally, but not as often as I used to. I'm becoming a believer in "pecking order," and that requires discipline on the human's part as well as the dog's. A dog that learns he can "play fight" with you is one step away from jockeying for the position of top dog.