Is it possible...?

I've made a scaffold project that has been edited so that when you create a new task, the show method will run though some ruby code that manipulates the data inputed. I want to make it so that when a user types in the url http://localhost:3000/some_controller/some_method/some_id_#, the ruby code won't run again. I tried to fix this problem by telling the program to check if the id exsist then don't run the ruby code and redirect the user, otherwise run the code. This didn't work becuase the id does get created.

The other solution I tried was to create an after_filter on the create method. The issue with this was that I couldn't get the parameters from the form and manipulate it.

I appreciate all the help I can get!

Thanks, Anon_comp

anon_comp wrote:

I've made a scaffold project that has been edited so that when you create a new task, the show method will run though some ruby code that manipulates the data inputed. I want to make it so that when a user types in the url http://localhost:3000/some_controller/some_method/some_id_#,

Can you explain in some more detail what you're trying to do here?

the ruby code won't run again. I tried to fix this problem by telling the program to check if the id exsist then don't run the ruby code and redirect the user, otherwise run the code. This didn't work becuase the id does get created.

Ok, well then there's a bug in your code: don't give up, try and fix it. Post your code up please.

The other solution I tried was to create an after_filter on the create method. The issue with this was that I couldn't get the parameters from the form and manipulate it.

The code in an after filter can access params. Post your code up please.

Can you explain in some more detail what you're trying to do here?

Basically taking a file that the user browsed on their local computer (in this case my own computer since I'm testing it), manipulate the file directory name and run it through an outside program. The outside program creates a file that the user can view and I don't want the ruby code activating again when the user reopens the show page.

Ok, well then there's a bug in your code: don't give up, try and fix it. Post your code up please.

This is the code for my first solution:

In Controller