Feed aggregator

Fair Use Week, Day Four: Stream It!

In Plain Sight - Thu, 2016-02-25 07:00

Today I’d like to highlight some webinars and videos that focus on fair use and its importance. The Association of Research Libraries (ARL) has put up links to five different videos on fair use from ARL Libraries. The videos cover the application of fair use to accomplish specific projects, discuss the ways in which fair use contributes to scholarly discourse, or outline the balance of rights within copyright.

If you’d like to move beyond fair use into some of the other copyright realms, check out the CopyTalk webinars hosted by the American Library Association’s Office for Information Technology Policy. You can view the archived webcasts as well as the PowerPoint slides. These webinars cover a broad range of copyright-related topics, including important court cases, the Trans Pacific Partnership, copyright information at Universities, fan fiction, music and copyright, and more.

Add a little irony to your day. One more just for fun (sorry, no video!): Sony Music Issues Takedown on Copyright Lecture about Music Copyrights by Harvard Law Professor. When you read the article, you’ll see that it seems a very strong case for fair use, but the takedown happened. Unfortunate.

Categories: In Plain Sight

Fair Use Week, Day Three: The Four Factors

In Plain Sight - Wed, 2016-02-24 07:00

The Fair Use doctrine in the U.S. copyright law is divided into four factors. It is the weighing of these four factors in an analytic process that help you determine whether your use of copyrighted material is “fair,” or whether you should seek permission for use from the copyright holder. The four factors of Fair Use are:

 The purpose and character of the use
 The nature of the copyrighted work
 The amount and substantiality of the portion used
 The effect of use on the potential market for the copyrighted work

All four factors are weighed when conducting a fair use analysis. For example, if a work is unpublished, it would weigh more against Fair Use for that factor (the nature of the copyrighted work) than if the work is published. Or, if you are using only a very small amount of the work (the amount and substantiality of the work), it would tend to favor for Fair Use.

How do you determine if a use is fair? As referenced in the first blog post this week,  you can use a fair use checklist to help you. Another tool you might want to try using to help with a fair use assessment is the Fair Use Evaluator. It allows you to input information related to the content you wish to use and it will weigh the factors for you. There’s also a nice Thinking Through Fair Use tool from the University of Minnesota Libraries. The nice thing about that tool is that once you’ve walked through the assessment, you can email a copy of the report to yourself; you will then have a record of your fair use assessment should anyone question you later. Also, many groups have developed Codes of Best Practices for Fair Use; depending on the type of use you need, one of these groups may have a set of guidelines and practices that will help inform you when you have a fair use question.

 

Categories: In Plain Sight

Fair Use Week, Day Two: Court Cases

In Plain Sight - Tue, 2016-02-23 14:17

It’s day two of fair use week, and I’ve been thinking of some of the court cases that have dealt with fair use. Fair use is for everyone, and there have been some good decisions favoring its application recently. The long running Google books lawsuit was finally settled when the Second Circuit Court of Appeals rejected the Author Guild’s copyright infringement claim; the Electronic Frontier Foundation writes a more detailed analysis of the case here.

Another important court case highlighting fair use is what’s called the ‘Dancing Baby’ lawsuit. This case is important to all of us; in it fair use was affirmed as a right and not just a defensive position. The court affirmed that copyright holders must consider fair use before issuing take down orders to remove Internet content. Now we can all worry less about having a snippet of music playing in the background when we post a short video to uTube.

For additional information on fair use court cases, check out Stanford’s Summaries of Fair Use Cases.

 

Categories: In Plain Sight

Fair Use Week

In Plain Sight - Mon, 2016-02-22 15:54

It’s Fair Use Week! Fair use is an important exception in US Copyright Law. It allows you to use portions of copyrighted material without permissions, as long as the use is “fair.” To determine whether a use is fair, you should conduct a fair use assessment for any copyright protected materials you use in your courses and lectures. To help you with the risk assessment, you can use a fair use checklist. The checklist is an easy way to weigh the four factors of fair use and determine whether you can use the copyrighted material fairly or whether you should request permissions for use from the copyright holder.To learn more about Fair Use, check out Fair Use Myths and Realities by the Association of Research Libraries.

We’re promoting Fair Use Week in the library with webinars and other events. Please join us for a webinar or meet our copyright expert. Bring your questions! If you can’t make it to any of the events, feel free to contact us with copyright questions any time. You can use the form below or the “contact us” form from the library’s website. [contact-form]

Categories: In Plain Sight

255 New Tobacco Industry Documents Posted

Industry Documents Library - Thu, 2016-02-18 15:09

A total of 255 new documents were posted to the Truth Tobacco Industry Documents Library today.
The breakdown is:

Say Hello to Atto!

Convergence - Thu, 2016-02-18 12:07

Did you know there is a new CLE text editor, called Atto? Not to worry, the current text editor (called TinyMCE) used to add text to CLE course pages, reply to forums, answer essay questions, and much more, is still available as the default editor in the CLE.

UCSF students, faculty, and staff are now able to select Atto as their CLE text editor. Why would you want to do this? The Atto editor improves usability and accessibility, and is also mobile-friendly. The Atto editor is designed with accessibility in mind and will even warn you when content that you have added to the editor is not accessible. And did we mention that you can now add images to the Atto text editor using drag and drop?

Here is what Atto looks like!

And below is what Atto looks like on a mobile device, such as an iPhone:

Interested in using the Atto editor? Follow the instructions below to change your CLE text editor:

  1. Log in to the UCSF CLE
  2. From the Navigation block, click My Profile > View Profile
  3. From the Administration block, click Edit Profile
  4. From the Text editor drop-down, choose Atto HTML editor
  5. Click Update Profile button

You can return to your CLE Profile at any time and switch back to the TinyMCE editor if you are not a fan of Atto.

Remember to avoid using Internet Explorer (IE) when accessing the CLE, as some functionality may not work, such as drag and drop. You can read more about recommended browsers for the CLE on the CLE FAQ.

Other features of the Atto editor include:

  • Improved usability and accessibility
  • Mobile and theme-friendly
  • Screenreader helper
  • Accessibility checker
  • Created and maintained by Moodle (the system that powers the CLE)

Want to learn more about using CLE Text Editors? Visit the Learning Tech Support Center (or click the image below) to view detailed instructions for using both the TinyMCE and Atto text editors. Atto will one day become the CLE default text editor, so give it a try and let us know what you think.

Have additional questions? Contact a Learning Tech Specialist today!

Categories: Convergence

1961 document from PM consultants acknowledging cancer-causing...





1961 document from PM consultants acknowledging cancer-causing materials in cigarette tobacco and brainstorming ways to reduce harm.  

Arthur D. Little. 1961. L&M - A PERSPECTIVE REVIEW

Read the entire document at: https://industrydocuments.library.ucsf.edu/tobacco/docs/qync0084

Medical Quackery Series: Bloodletting

Brought to Light Blog - Wed, 2016-02-17 10:45

In this series, we’ll be exploring artifacts and other material from our collections related to medical misinformation and fraud. Step right up folks and learn how everything from bleedings to electricity can cure your ills!

Bloodletting as a medical practice has existed for thousands of years; ancient peoples, including the Greeks and Egyptians, used bloodletting to cure numerous conditions. The treatment, which involved draining blood with leaches or by puncturing the skin with a sharp instrument, was based on the theory of bodily humors. People believed that good health resulted from a balance of the four humors: blood, phlegm, yellow bile, and black bile. A person suffered illness when these humors became unbalanced. Bloodletting was devised as a way to correct harmful imbalances in the body.

“Old wooden barber pole. 1900.” From the Graves (Roy D.) Pictorial Collection, ca. 1850-1968. Courtesy of the Bancroft Library, University of California, Berkeley, accessed via Calisphere: https://calisphere.org/item/ark:/13030/tf1r29n9jj

In Europe and the United States, surgeons and barbers offered bloodletting as a treatment for just about everything, from pneumonia to gout to cancer. Barbers so regularly performed bloodletting that they adopted a symbol to help advertise the service: the barber’s pole, a red and white striped pillar reminiscent of blood and bandages.

Leaches and a number of different instruments were used for bloodletting in the 18th and 19th centuries. The lancet was one of the simplest tools; it consisted of a sharp, pointed blade attached to a straight handle. A variation of this was the fleam, a wide double-edged blade at a right angle to the handle. The folding fleam pictured here includes two blades encased in a brass shield.

Folding fleam. Artifact Collection, number 431.

Folding fleam. Artifact Collection, number 431.

A spring lancet was more mechanized. It included a spring trigger that snapped the blade into a vein. Spring lancets were, perhaps unsurprisingly, difficult to clean and often became rife with bacteria.

Spring lancet and case. Artifact Collection, number 416.

Detail of spring lancet. Artifact Collection, number 416.

Scarificators allowed for multiple cuts to be made at once. The octagonal or round base housed six to twenty blades that released from the bottom with the flick of a lever.

Scarificator. Artifact Collection, number 518.

Removing scarificator from original box. Artifact Collection, number 518.

Detail of scarificator with blades extended. Artifact Collection, number 518.

Blades of scarificator. Artifact Collection, number 518.

Bleeding bowls were often used to catch blood during the procedure. These came in different sizes and material, including brass, ceramic, and pewter.

Bleeding bowl. Artifact Collection, number 557.

Today, bloodletting is widely discredited as a medical treatment. However, phlebotomy therapy is used to treat certain conditions, including hemochromatosis, a genetic disorder that causes abnormal iron accumulation. Leaches are making a comeback too; some reconstructive surgeons use them to restore circulation following procedures.

To view more bloodletting instruments, make an appointment with the UCSF Archives. You can also check out our exhibit on the third floor of the UCSF Library until April 2016. You’ll see a 19th-century spring lancet engraved to UC Medical College Dean Richard Beverly Cole from his mother!

Categories: Brought to Light

Celebrating Valentine’s Day

Brought to Light Blog - Fri, 2016-02-12 12:00

A heart is a universal symbol of the Valentine’s Day. We would like to share with you a selection of heart illustrations from the UCSF Rare Book Collection.

Diagrams of the heart. Lower, Richard. Richardi Lower … Tractatus de corde : item de motu, colore, & transfusione sanguinis, et de chyli in eum transitu, ut et de venae sectione : his accedit Dissertatio de origine catarrhi .., 1728.

Illustrations of the heart and lungs. Verheyen, Philip. Corporis humani anatomiae, 1710.

Diagram of the heart. Cabrol, Barthelemy. Ontleedingh des menschelycken lichaems, 1633.

Illustrations of the heart and lungs. Vesling, Johann. Syntagma anatomicum, 1666.

Categories: Brought to Light

Wyeth ‘Setting the Scientific Agenda’ for Hormone...





Wyeth ‘Setting the Scientific Agenda’ for Hormone Replacement Therapy (HRT) drugs - Ghostwriting, CMEs, Industry Sponsored Research…

https://industrydocuments.library.ucsf.edu/drug/docs/xzdw0217

This document is one of the many internal company documents produced in litigation against manufacturers of hormone replacement therapy by women who developed breast cancer while taking HRT. The documents show how Wyeth contracted with “medical communication” companies to market the Premarin product line with campaigns that included the publication of ghostwritten articles published by leading peer-reviewed journals, presentation of ghost-authored posters at professional association conferences and involvement in academically-sponsored continuing medical education events.

This document along with many more were used as resources for articles  such as:  Fugh-Berman AJ (2010) The Haunting of Medical Journals: How Ghostwriting Sold “HRT”  PLoS Med 7(9): e1000335. doi:10.1371/journal.pmed.1000335

See more from the UCSF Drug Industry Documents Prempro Litigation collection

Kezar Stadium: The Original Home of Professional Football in the Bay Area

Brought to Light Blog - Wed, 2016-02-03 11:20

Before there was Levi’s Stadium, there was Candlestick Park—and before there was Candlestick, there was Kezar Stadium. In light of the Super Bowl 50 festivities happening on the Embarcadero right now—celebrating a game some 40 miles south of the city—it is good to remember that the original home to both of the Bay Area’s professional football teams is less than five blocks away from UCSF Parnassus.

UCSF aerial, 1959. Kezar in top right corner.

Built in 1924-1925, Kezar first served as a multi-purpose stadium hosting a myriad of sports, ranging from track and field to soccer to cricket. After the San Francisco 49ers inaugural season in 1946, the facility became primarily a football stadium, staging games for the next 25 years, including the Oakland Raiders first four home games in 1960. Though never home to a Super Bowl, Kezar did host two NFL conference championships, including the 49ers last home game there on January 3, 1971 against the Dallas Cowboys.

UCSF aerial, 1938. Kezar to left of frame.

UCSF aerial, circa 1955. Kezar in foreground.

In addition to football and other sports, Kezar stadium presented many other concerts and events, and had a memorable role as the home and workplace of the Scorpio killer in the first Dirty Harry movie. It was torn down in 1989, prior to the Loma Prieta earthquake, and rebuilt in its current incarnation as a much smaller, 10,000 seat venue (some 50,000 seats smaller than its original capacity of 59,942). It was recently renovated, and now features 1,000 seats from Candlestick Park.

UCSF aerial, 1969. Kezar at top left.

Categories: Brought to Light

Article Spotlight: Tobacco is “our industry and we must support it”; Zimbabwe and the FCTC

Industry Documents Library - Mon, 2016-02-01 13:13

Every month, we highlight a newly published article/post/report along with a few key industry documents used in the paper as a primary source:


Lown EA, McDaniel PA, Malone RE.
Tobacco is “our industry and we must support it”: Exploring the potential implications of Zimbabwe’s accession to the Framework Convention on Tobacco Control.
Globalization and Health. 2016 Jan 11;12(1):2-015-0139-3

Zimbabwe is currently the largest tobacco producer in Africa and has a long history of tobacco growing. Zimbabwean government officials have been outspoken critics of the WHO’s Framework Convention on Tobacco Control (FCTC). Despite this opposition, Zimbabwe recently acceded to the FCTC to better protect their tobacco growing interests. FCTC membership obligates nations to implement a variety of tobacco control measures and Zimbabwe has implemented several aimed at reducing tobacco demand but fewer aimed at reducing supply or protecting the environment.

The authors argue Zimbabwe’s decision to accede to the FCTC does not appear to represent a softening of its historical opposition to the treaty. Its status as a Party, therefore, creates opportunities for the government to undermine ongoing efforts to implement and strengthen the treaty. At the same time, however, Zimbabwe’s accession could provide worldwide support for its Ministry of Health to develop stronger tobacco control measures. How Zimbabwe’s participation impacts the work of the FCTC as a whole may ultimately depend on the allegiances of its delegates and the effectiveness of measures to limit tobacco industry interference and enforce compliance.

Key Documents from the UCSF Truth Tobacco Industry Documents:

  • (n.d.) Briefing from Zimbabwe Tobacco Association and the International Tobacco Growers’ Association.
    Available: https://industrydocuments.library.ucsf.edu/tobacco/docs/rhwn0192
    The Zimbabwe Tobacco Association (ZTA) and the International Tobacco Growers Association (ITGA), are influential in Zimbabwe. The ZTA was founded in 1928 (originally as the Rhodesian Tobacco Association) to “promote and support research and training to ensure the continued development and expansion of the flue-cured tobacco growing industry.”
  • TSF; Zimbabwe Tobacco (1998) In Support of Tobacco Indigenisation Training Programmes Million Zim Dollars Donation from Philip Morris.
    Available: https://industrydocuments.library.ucsf.edu/tobacco/docs/snlw0080
    The ZTA’s offshoot, the Farmers Development Trust, was the recipient of several US$100,000 grants from Phillip Morris.
  • INFOTAB;Bloxcidge, John A. (1988) International Tobacco Growers’ Association (ITGA).
    Avaialable: https://industrydocuments.library.ucsf.edu/tobacco/docs/pxxh0203
    The ZTA and representatives of five other tobacco-growing nations founded the ITGA with funding from transnational tobacco companies.
  • BAT Zimbabwe; Parirewa, Peter (1994). Mughabe on Anti-Smoking Lobby.
    Available: https://industrydocuments.library.ucsf.edu/tobacco/docs/xzff0194
    Vera, Ivan (2000) Zimbabwe Tobacco Industry Faces New Threat from WHO.
    Available: https://industrydocuments.library.ucsf.edu/tobacco/docs/yqdn0192
    Zimbabwe government officials and growers’ organizations have been outspoken supporters of tobacco growing and critics of the FCTC, often minimizing the risk of tobacco use.

“Thus, those who smoke flavored cigarettes are likely to be...




Excerpt from page 10

“Thus, those who smoke flavored cigarettes are likely to be young, inexperienced, starting smokers, or occasional, infrequent smokers, or fashion- and fad-conscious women.”

Smokers Reaction to a Flavored Cigarette Concept - A Qualitative Study -  Brown & Williamson Tobacco Company

Kapuler & Associates; 1984 January - Brown & Williamson Collection - https://industrydocuments.library.ucsf.edu/tobacco/docs/pfvk0144

Who were flavored cigarettes going to be aimed at? Youth and starter smokers. Read the entire in-depth study on flavored cigarettes including focus group reactions to different flavors, user imagery, and suggestions for meeting unmet smoker needs.  

From the Drug Industry Documents Archive: 1984 Confidential memo...



From the Drug Industry Documents Archive: 1984 Confidential memo re: an excess inventory of non-heat treated AHF (anti-hemophiliac factor blood product) to be “dumped” in the Asian market…

Bayer and its company Cutter Laboratories manufactured AHF (anti-hemophiliac factor), a blood product used by hemophiliacs to treat uncontrolled bleeding. In the late 1960s the corporation began manufacturing AHF using pools of blood (plasma) from thousands of donors, often recruited from populations at high risk for hepatitis.

In the early 1980s Cutter Laboratories realized that its AHF was contaminated with HIV but its financial investment in the product was considered too high to destroy the inventory. Cutter continued to sell the contaminated AHF to markets willing to accept it, including overseas markets in Asia and Latin America, without the recommended precaution of heat treating the product to eliminate the risk. Customers were not informed of the risk and as a consequence, hemophiliacs who infused the HIV-contaminated AHF tested positive for HIV and developed AIDS.

These documents are from class action litigation against Bayer from both US and Taiwanese plaintiffs. While some of the cases involved HIV-infected hemophiliacs in the United States and abroad, these documents focus on the marketing and distribution of contaminated blood products in Asia; the “dumping” aspect of the larger body of cases litigated.

See all documents from this collection.

See also, the article Blood Money: Bayer’s Inventory of HIV-Contaminated Blood Products and Third World Hemophiliacs, for a detailed look into this case and documents.

Cable Car Day

Brought to Light Blog - Mon, 2016-01-11 11:17

January 17th is Cable Car Day! This occasion marks the day Andrew Smith Hallidie received the first patent for cable car railways in 1871. Legend has it that Hallidie was inspired to create the cable car after witnessing horses struggle to pull carriages up San Francisco’s steep hills.

San Francisco cable car. From UCSF MediCal yearbook, 1968

Hallidie first tested the cable car in San Francisco in 1873.  Hallidie partnered with Clay Street Hill Railroad that year and by September the company offered public service in San Francisco.

San Francisco cable car. From UCSF MediCal yearbook, 1968

Cable car companies faced competition from electric streetcars throughout the late 19th and early 20th centuries.  Streetcars, which run on steel rails and are connected to overhead wires, were cheaper to build and maintain than cable cars, which run on steel rails and are propelled by an underground cable.

Streetcar in front of the UC Affiliated Colleges (later UCSF), circa 1910. From photograph collection.

San Francisco cable car. From UCSF MediCal yearbook, 1968

By the mid-20th century, San Francisco was considering completely eliminating cable car lines. Concerned citizens protested the proposal and, thanks to their efforts, the cable cars were saved.Today, San Francisco’s cable cars are protected as a National Historic Landmark. You can still ride on a San Francisco cable car; visit SFMTA’s website for tickets and more information.

 

Categories: Brought to Light

Article Spotlight: Philip Morris and the Use of Third Parties to Oppose Ingredient Disclosure Regulations

Industry Documents Library - Fri, 2016-01-08 16:16

Every few months, we highlight a newly published article/post/report along with a few key industry documents used in the paper as a primary source:

Velicer C, Glantz SA (2015) Hiding in the Shadows: Philip Morris and the Use of Third Parties to Oppose Ingredient Disclosure Regulations. PLoS ONE 10(12): e0142032. doi:10.1371/journal.pone.0142032

In 1996 Massachusetts proposed regulations that would require tobacco companies to disclose information about the ingredients in their products. This December 2015 paper examines the strategies employed by Philip Morris to stop these regulations from being implemented. The authors used tobacco documents to demonstrate the tobacco companies’ historical use of third parties to form coalitions to oppose ingredient disclosure regulations and how these coalitions have prevented regulations by creating the appearance of local opposition to the measures.

Key Documents from the UCSF Truth Tobacco Industry Documents:

  • Chayet N (1996) Ingredient Disclosure. 12 Nov 1996. Available: https://industrydocuments.library.ucsf.edu/tobacco/docs/tnxp0076
    Document from a communications firm contracted by Philip Morris that warns “food police” could use a similar approach to food “containing caffeine, fat, or whatever else zealous consumer organizations believe is harmful.”

  • Salinsky R (1997) M.G.L. Chapter 94, Section 307a, Proposed Implementation Regulations. 20 Feb 1997. Available: https://industrydocuments.library.ucsf.edu/tobacco/docs/yylp0054
    Richard Salinsky, then president of the Best Petroleum Company based in Massachusetts and member of the Society of Independent Gasoline Marketers of America (SIGMA), argued in a public comment to the Dept of Public Health, that the proposed regulations did not protect consumers because it could create the illusion of safer cigarettes. Stalinsky said, “rather than having an effect of reducing risks to public health, [the regulations] have the opposite effect of increasing such risks by creating a false illusion that some brands of cigarettes are ‘more healthy’ than others.”

  • Vermont Ingredients Disclosure Plan. 16 Aug 1996. Available: https://industrydocuments.library.ucsf.edu/tobacco/docs/qjyh0045
    Philip Morris political strategy for fighting ingredient disclosure in Vermont that mirrored its Massachusetts activities in 1996 and 1997 and provides a more detailed description of its two-phase approach to defeat the bill: (1) building third party alliances (the “educational outreach”), and (2) legislative phase.

  • Project Breakthrough. 1994. Available: https://industrydocuments.library.ucsf.edu/tobacco/docs/pyhc0003
    RJ Reynolds launched “Project Breakthrough” a campaign to convince Americans that anti-smoking advocates wanted cigarettes to be completely prohibited. The campaign was aimed at spreading the fear that other products could be made illegal including alcohol, beef, pork, private property, logging, fur, cholesterol and motorcycles.

Rails and Ember without rails-api

CKM Blog - Thu, 2016-01-07 17:06

This is a follow up to a post I wrote a couple months ago, “Ember and Rails Scaffolding for Simple Crud”. In that post, I gave an overview for how to generate simple CRUD scaffolding for an Ember app using Rails purely as an api through the rails-api gem.

Here’s the thing… if you take the api-only approach, you by design give up the ability to write standard Rails views. This can be a good thing, of course, which is why the gem was integrated into Rails 5. If all you want is an api, you don’t want the extra weight of everything else that comes with Rails, and you always can add various gems back in as needed. But for now, you may want to preserve the ability to write a full MVC rails app while still providing an API for Ember or other single page javascript frameworks.

Fortunately, this isn’t especially difficult. The Rails side will get a little more verbose, at least the way I’m writing it, but all you need to do is ensure that your app responds to both html and json – and of course be particularly careful to make sure that you don’t mix view logic with backend logic.

So, here we go…

First, create a full rails app with basic CRUD for the User model in the previous tutorial. I’m not going to repeat the steps here since they won’t change much. The only difference here is that instead of doing this with the rails-api gem and command, you’ll now do this with traditional rails. You will still need to create serializers, add rack/cors, allow access to various HTTP actions in the Rails app, and so forth. This is all available through the previous tutorial, with one change – you don’t need to install the rails-api gem, and wherever it says “rails-api generate…”, instead just use “rails generate…”.

You should now have a fully functional rails app for CRUD operations on a User that also provides json formatting as an api. The main difference between the api for a traditional Rails app and the rails-api generated app is that the traditional rails app responds by default as html, whereas rails-api responds as json. To get a json response from the traditional rails app, you will need to append “.json” to the url – in other words, to get the list of users rendered as json rather than displayed as html, you’d need to request:

http://localhost:3000/users.json

whereas the rails-api version doesn’t require this extension, as a rails-api app by default returns json (and wouldn’t normally respond as html at all).

On the Ember side, we need to instruct the adapter to specifically request json from the Rails app, as this is no longer the default Rails response.

To accomplish this, we will modify the Ember adapter in app/user/adapter.js

import DS from 'ember-data'; export default DS.RESTAdapter.extend({ host: 'http://localhost:3000', buildURL: function(record, suffix) { var s = this._super(record, suffix); return s + ".json"; } });

As you can see, this will append “.json” to all the requests send from Ember to Rails – even post, put, and delete requests , so you’ll need to explicitly handle the json format in any Rails controllers you intend to make available to Ember. As a result, we’ll need to modify the update and create methods in the Rails controller to specifically respond with json for Ember.

There is, inevitably, one more wrinkle – although Rails does respond by default to the “.json” extension, Ember expects a slightly different formatting, so you’ll need to make a few tweaks to get it working with Ember. Here’s the full controller code:

class UsersController < ApplicationController before_action :set_user, only: [:show, :edit, :update, :destroy] # GET /users # GET /users.json def index @users = User.all #render json: @users respond_to do |format| format.html format.json { render json: @users } end end # GET /users/1 # GET /users/1.json def show respond_to do |format| format.html format.json { render json: @user } end end # GET /users/new def new @user = User.new end # GET /users/1/edit def edit end # POST /users # POST /users.json def create @user = User.new(user_params) respond_to do |format| if @user.save format.html { redirect_to @user, notice: 'User was successfully created.' } format.json { render :show, status: :created, location: @user } else format.html { render :new } format.json { render json: @user.errors, status: :unprocessable_entity } end end end # PATCH/PUT /users/1 # PATCH/PUT /users/1.json def update respond_to do |format| if @user.update(user_params) format.html { redirect_to @user, notice: 'User was successfully updated.' } format.json { render :show, status: :ok, location: @user } else format.html { render :edit } format.json { render json: @user.errors, status: :unprocessable_entity } end end end # DELETE /users/1 # DELETE /users/1.json def destroy @user.destroy respond_to do |format| format.html { redirect_to users_url, notice: 'User was successfully destroyed.' } format.json { head :no_content } end end private # Use callbacks to share common setup or constraints between actions. def set_user @user = User.find(params[:id]) end # Never trust parameters from the scary internet, only allow the white list through. def user_params params.require(:user).permit(:name) end end

You may notice some additional code in create and update. This is because we need to respond as json for Ember, which we configured to submit all requests with the .json extension (even POST and PUT requests).

At this point, you can bring up both a Rails app on port 3000 and an Ember app on port 4200 and use both a standard Rails view and the Ember client for CRUD operations on your User model.

This does require some extra overhead, but it does keep open the possibility of writing a traditional Rails app while providing an API for not just Ember but any other app that might want to consume a Rails API.

Categories: CKM

Need to Know More About Mendeley?

In Plain Sight - Wed, 2015-12-09 17:45

If you’re interested in learning more about Mendeley, or need access to help tutorials or guides, you should look at this new Mendeley  Resource Center site:

 

Categories: In Plain Sight

EndNote Word Plug-In Not Compatible with Office 2016 on Mac

In Plain Sight - Mon, 2015-11-16 14:08

From EndNote’s website:

“Cite While You Write is not currently compatible with Office 2016 on Macintosh.

We are actively developing a patch for EndNote X7 to fix this compatibility issue. We anticipate this free update to X7 to be ready by the Fall. We understand EndNote’s importance in completing your work and apologize for any inconvenience caused. To support Mac workflows as we develop the patch, we have the following recommendations to help Microsoft Office 365 users continue to create formatted citations and bibliographies in Microsoft Word.

It is possible to have both Office 2011 and Office 2016 on the same computer. If you want or need to install Office 2016, the recommendations outlined below will enable your continued use of EndNote to create formatted citations and bibliographies in your Word documents.”

More information.

 

Categories: In Plain Sight
Syndicate content