-
Notifications
You must be signed in to change notification settings - Fork 19
New feature - Reverse post :-) #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…he words in a post
… we should do something totaly else. I'm gonna stop writing the cucuember for it, and move on to merging articles
| def new_or_edit | ||
| @categories = Category.find(:all) | ||
| @category = Category.find(params[:id]) | ||
| @category = Category.new if params[:id].nil? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would execute less code if you used an if/else here
|
Looks like you added the db_development and db_test files back in accidentally |
| split_text.each do |word| | ||
| reverse_string = reverse_string + " " + word | ||
| end | ||
| reverse_string = text.split.reverse!.join(" ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep! looks much better!
So it's not what we were supposed to do, but still a sweet feature that works + passing cucumber tests.
When you go to admin/content page , just where you can edit/show /delete your post - you'll notice a new button "Revers" .
Once you'll push it, the words in your post will show in the reverse order :)
You can always get the origin post back by pushing the revers button again!
Link for Heroku site:
https://pure-crag-95718.herokuapp.com/admin/content