Wednesday, February 29, 2012
Wednesday, February 15, 2012
Rails javascript Tag
Using javascript tag allows you to include ruby code in javascript so that it gets interpreted when code is generated.
Here is an example wherein format for AnyTime.picker is dependent on the report for which the approach time field is rendered.
Here is an example wherein format for AnyTime.picker is dependent on the report for which the approach time field is rendered.
<%= javascript_tag "AnyTime.picker( 'approach_time', { format: '#{@report.approach_time_format_picker}', firstDOW: 0 } );"
Sunday, February 12, 2012
ActiveRelation in Session
If you ever see this:
You are probably trying to store an ActiveRelation in the session.
TypeError (no marshal_dump is defined for class Mutex):
You are probably trying to store an ActiveRelation in the session.
Thursday, February 9, 2012
Adding a New Report
Adding new reports for ASC is straightforward, though not yet automated. This example illustrates adding the TutorDropInReport.
- Add entry to routes file:
resources :tutor_drop_in_reports, :controller => "tutor_reports"
- Create empty model
TutorDropInReport
that extends Report. - Create ReportType entry. See seeds.rb
- Create field descriptors. See seeds.rb
- Add to menu view, views/organizations/orgs/AcademicSkillsCenterOrganization/_reports_menu.html.erb
- Add to MY_REPORTS in models/academic_skills_center_organization.rb
- Update config/locales/en.yml
Subscribe to:
Posts (Atom)