We're developing an app in Rails, and want to randomly display a question to users that they haven't seen yet. Once they answer, it would show the results, and then ask if they want to answer the next question.
Has anyone done this? Is there perhaps some kind of gem that can help us, or do we have to write it from scratch?
Thanks in advance!
I've used the randumb gem for something similar. With it you can use scopes to chain your queries so you could fetch only an un_seen record (and subsequently update it to seen)
https://github.com/spilliton/randumb
Related
Can you search for submissions (over all subreddits) to find those having a particular keyword use in the discussions i.e comments of that submission?
I am trying to :
Collect all the submission ids and hence the comments that have this word say "awesome".
I would also like to know if there are some subreddits that are likely to have this word used often based on the comments?
I have already looked at PRAW & PSAW documentation and even found the exact solution to this problem i.e the aggs paramter but apparently it is not working at the moment? Every query gives me a JSON that is empty(with the same code as in the documentation)?
I was wondering if there are alternatives or workarounds to this? Or something that could solve my problem.
Thanks in advance for your time.
I'm developing an app in Rails with a nutrient database. Now I'm looking for an easy solution for users to search the database through a search field, which as they type will present a list of records from the database, which at the same time are clickable and once clicked will direct them directly to the show path of that nutrient.
I'm thinking of something like this. If you enter e. g. "burger" it does exactly what I need.
I've been researching now for some days and found solutions from jQuery autocomplete to Elasticsearch to typeahead.js but now I'm totally lost, which solution would be the right one for my usecase (I tried jQuery autocomplete but at the end it turned out that this is not exactly what I need).
Anybody some ideas?
Thanks.
Algolia is a well known solution for instant search, but not the easiest one to implement (though their support team is incredible).
You should look into searchkick which is based on elasticsearch, and has an instant search feature.
It is relatively easy to implement, and pretty well documented.
In my app so far, I have to implement all the Twitter posts from a certain individual into a table view, and it automatically updates when the person tweets a certain post. Is it possible to mention a certain individual e.g. #John.. If it is possible, how can I do it? If not just let me know and I will delete this question as it could be too ambitious. Thanks!
I don't quite understand what you mean. I do a little!
There is a quick and easy way of doing this! One easy way is to use Twitters own SDK called Fabric. See Here
See this link for the timeline stuff and integration to your app Documentation
This should help you out!
P.S. Let me know how you get on!
I am new to web development. Currently I am designing a website where people can purchase different stuff. The website has got a number of special offers such as if you shop for more than $200, you get 20% off, if you shop for 3 similar items, you get a fourth one free.
Can anybody just point me in the right direction what is the best way to do this? Also if the offer changes, I donot have to change a lot of code.
thanks!
You can use various e-commerce and payment gems like the ones in Railscasts.
Some more gems for this purpose are here - The Ruby Toolbox and here too.
As mentioned in the comments, you can use the Saas products like Shopify but that's not free.
I'll point you to some code that should help you out.
For example, " if you shop for 3 similar items, you get a fourth one free. " in ror_ecommerce this is a "Deal". The code is here:
https://github.com/drhenner/ror_ecommerce/blob/master/app/models/deal.rb
This code is not straight forward but basically looks for the best deal an order qualifies for.
if you have buy 2 get one free you might want to implement buy 4 get 2 free and buy 6 get 3 free...
Similiarly ror-e has sales. The only thing you would need to add is a condition for order.total and pass that value into the Sale.for method.
I hope this helpss
DISCLAIMER: I wrote the code!
My needs are reasonably simple but I cannot seem to find a working solution. Any help is greatly appreciated. I don't want to start implementing something from scratch if I can use a open source solution that is well stablished and I can eventually contribute in some way.
My Requirements
1- I need to have all events stored in the database so I can fetch them (and their content) with a background process for manipulation. I will process all events once/twice a day for any given day. Processing mainly consists of sending out reminders etc.
2- I need to allow recurring events.
3- I need custom forms and application specific custom fields for all events.(this seemed to leave google calendar out)
4- UI needs to display events depending on user logged in.
5- all day events not required
What I have looked at so far:
FullCalendar: Seems the most plausible although I haven't yet figured out how to accomplish #3 above.
event_calendar: I have no idea how to implement recurring events efficiently using this solution. It seems like I would have to implement it from scratch using iCal's standards etc. Does not sound like fun. Any suggestions here?
Ice_Cube: This would potentially help with the event_calendar recurring event implementation.
I have not worked with calendars before so I might be missing something really simple. Please let me know your thoughts.
Env: Rails 3.1, looking for gem/plugin/JQuery solution. If not found will try to implement from scratch. =) Thank you for your help.
Check dhtmlxScheduler, it solves all above requirements.
Also, there is a ROR integration sample