Saturday, July 17, 2010

[Rails] Re: Question regarding controller actions (And a little bit of REST)

I would try to use 2 radio buttons, or a select box with values:

* Approved
* Not approved
* ... other states

Then, you embed the processing of these values in the UPDATE action.
For a select box, this might help you to start:

<li>
<%= select(:blogpost, "status_id", Status.all.collect {|p| [ p.name,
p.id ] }) %>
</li>

hph,

patrick


On 17 Jul., 12:29, Marco Antonio Filho <marcoafi...@gmail.com> wrote:
> Hi Guys,
>
> I am developing a blog system with Rails and I have a question about the
> following matter:
>
> My client wants me to create an *approve* and *disapprove* action for the
> comments.
>
> So, I did create two actions in the rails comment controller called by a *
> put* method, since the only thing they do is change the *approved* collumn
> at the database. I am still not familiar with REST, so I decided to ask what
> you would do in a situation like this.
>
> Another way I was thinking is create an action update and there I would
> handle if I get a params[:approve] or a params[:disapprove]. I know it is a
> quite simple question, but I did research, but I think I didn't find the
> right keywords to look for it.
>
> Thanks for any inputs in advance.
> Marco Antonio

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate