Rails: display events with calendar_date_select - ruby-on-rails

I'm trying to display events in calendar generated by calendar_date_select plugin for Rails.
I have Concert model with datetime field date.
Can I somehow throw in #concerts which equals Concert.all to calendar_date_select_tag to display links to make days where concert is clickable?
I would like to stick to this helper cause I would like to use it as a pure date picker in other places of my app, but have no idea how to achieve my goal.
Sorry if this question is lame, I'm very new to magic Rails world.

I don't think the plugin currently allows for this.
You can certainly put in a feature request though - look at the bottom of the page and send an email to the main guy!

Related

Best solution for clickable search list in Rails

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.

Using grails filterpane plugin with one "search" input field

is it possible to use the grails filterpane-plugin in a way that uses just one search box? i know it seems a little odd, because obviously the whole thing about this plugin that the user can specify what attributes should be filtered in what kind and with whatever filter terms.
What i would like to achieve is, that the user can search for any attribute that is displayed in the grid like it is possible in this jira example. i know i could come up with something like the searchable plugin to get that done, but im not sure how i could combine this with the standard filter activities that are provided by the filterpane plugin, so i'm looking for a solution that is based on filterpane. If you have any advice or opinion about the searchable-plugin solution, please let me know.
Thanks
I use the quick search plugin for this in my app.

Display current page in rails haml template

I know this is crazy simple, but I can't figure it out even after reviewing the HAML docs. How do you return the current page/path (current_page). I want to add a simple share on Twitter link to my app that contains the current path.
%a.twitter{href: "https://twitter.com/intent/tweet?url=CURRENT_PAGE_?????&text=#{blah}"} Tweet
Use request.url. It's available in controllers and views.

Using Drupal to do what Digg Does

I'm trying to create a site where, like Digg, a user can submit a link and using ajax it attempts to pull the metadata from the page into a title and description field. The user can change either of these fields then submit the content.
Ideally a module already exists. I tried playing around with Feeds, but I'm not sure if I'm looking in the right place.
I probably have to create my own custom module.
Any suggestions? Can I tap into the Feeds API just to parse the url then take the results and do all the mapping myself? Assuming I want to create my own form and bring in my own ajax.
You could probably do that with Feeds, but I think it might be overkill and could be difficult to configure.
You could do what you're looking for in a relatively small custom module using hook_form_alter to customize the submission form, arg() to determine the URL being submitted, drupal_http_request to retrieve the page, then the Form API's #default_value setting to pre-populate the field(s).
The Prepopulate module does a lot of what you're looking for. If it provides hooks (I'm not sure if it does) all you would need to do is add the drupal_http_request, to handle fetching the metadata.
In Drupal it's called Drigg ;). It is supposed to a nice Drupal module to get the functionality of Digg. It will be worth a try I suppose.

How to display events in the calendar using Ruby?

I am building a calendaring application in ruby on rails. I am using my own schema for storing events, but I don't know how to display events in calendar, and also how to add a calendar in my application.
Will I have to write code to display calendar or can I use any plugin to display calendar.
I think the calendar_helper plugin is what you want. It provides a calendar method to your views, which can be called to generate a month-view calendar in HTML.
You can pass it a block which builds the contents of each day's cell, which is where you would want to do whatever your event schema requires to pull in the day's events.
The EventCalendar plugin was created for this very reason. Easily show multiple, overlapping events across calendar days and rows.
http://github.com/elevation/event_calendar
Screenshot(s) at: http://dev.elevationblog.com/2009/7/23/event-calendar-rails-plugin
There's a little list of candidates here.
The plugin on the page itself seems to offer some AJAX goodness, if that's something you're interested in.
I also had to build a calendar in rails. None of the existing calendar gems appealed to me as they did too much. I wanted to render the calendar myself so I could control the styling. I also had an existing Event model so I didn't need any kind of event handling. I ended up creating the cal gem. It's pretty straightforward when you look at the README. I plan to improve it to have weekly and daily calendars. Good luck!

Resources